File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
java/io/serverlessworkflow/impl/test/shell
resources/workflows-samples/shell-process Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,24 @@ void testEchoWithEnvironment() throws IOException {
8181 }
8282 }
8383
84+ @ Test
85+ void testTouchAndCat () throws IOException {
86+ Workflow workflow =
87+ WorkflowReader .readWorkflowFromClasspath (
88+ "workflows-samples/shell-process/touch-cat.yaml" );
89+ try (WorkflowApplication appl = WorkflowApplication .builder ().build ()) {
90+ WorkflowModel model =
91+ appl .workflowDefinition (workflow ).instance (Map .of ("lastName" , "Doe" )).start ().join ();
92+ SoftAssertions .assertSoftly (
93+ softly -> {
94+ ProcessResult result = model .as (ProcessResult .class ).orElseThrow ();
95+ softly .assertThat (result .code ()).isEqualTo (0 );
96+ softly .assertThat (result .stderr ()).isEmpty ();
97+ softly .assertThat (result .stdout ()).contains ("hello world" );
98+ });
99+ }
100+ }
101+
84102 record Input (User user ) {}
85103
86104 record User (String name ) {}
Original file line number Diff line number Diff line change 1+ document :
2+ dsl : ' 1.0.1'
3+ namespace : test
4+ name : run-shell-example
5+ version : ' 0.1.0'
6+ do :
7+ - runShell :
8+ run :
9+ shell :
10+ # write hello world to a file and then cat it
11+ command : echo "hello world" > /tmp/hello.txt && cat /tmp/hello.txt
12+ environment :
13+ FIRST_NAME : John
14+ LAST_NAME : ${.lastName}
15+
You can’t perform that action at this time.
0 commit comments