25
25
import io .serverlessworkflow .api .produce .ProduceEvent ;
26
26
import io .serverlessworkflow .api .schedule .Schedule ;
27
27
import io .serverlessworkflow .api .start .Start ;
28
- import io .serverlessworkflow .api .states .DelayState ;
28
+ import io .serverlessworkflow .api .states .SleepState ;
29
29
import io .serverlessworkflow .api .workflow .Events ;
30
30
import io .serverlessworkflow .api .workflow .Functions ;
31
31
import org .junit .jupiter .api .Test ;
32
32
33
33
import java .util .Arrays ;
34
34
35
- import static io .serverlessworkflow .api .states .DefaultState .Type .DELAY ;
35
+ import static io .serverlessworkflow .api .states .DefaultState .Type .SLEEP ;
36
36
import static org .junit .jupiter .api .Assertions .*;
37
37
38
38
public class WorkflowToMarkupTest {
@@ -44,22 +44,22 @@ public void testSingleState() {
44
44
new Schedule ().withInterval ("PT1S" )
45
45
))
46
46
.withStates (Arrays .asList (
47
- new DelayState ().withName ("delayState " ).withType (DELAY )
47
+ new SleepState ().withName ("sleepState " ).withType (SLEEP )
48
48
.withEnd (
49
49
new End ().withTerminate (true ).withCompensate (true )
50
50
.withProduceEvents (Arrays .asList (
51
51
new ProduceEvent ().withEventRef ("someEvent" )
52
52
))
53
53
)
54
- .withTimeDelay ("PT1M" )
54
+ .withDuration ("PT1M" )
55
55
)
56
56
);
57
57
58
58
assertNotNull (workflow );
59
59
assertNotNull (workflow .getStart ());
60
60
assertEquals (1 , workflow .getStates ().size ());
61
61
State state = workflow .getStates ().get (0 );
62
- assertTrue (state instanceof DelayState );
62
+ assertTrue (state instanceof SleepState );
63
63
assertNotNull (state .getEnd ());
64
64
65
65
assertNotNull (Workflow .toJson (workflow ));
@@ -78,19 +78,19 @@ public void testSingleFunction() {
78
78
.withOperation ("testSwaggerDef#testOperationId" )))
79
79
)
80
80
.withStates (Arrays .asList (
81
- new DelayState ().withName ("delayState" ).withType (DELAY )
81
+ new SleepState ().withName ("delayState" ).withType (SLEEP )
82
82
.withEnd (
83
83
new End ()
84
84
)
85
- .withTimeDelay ("PT1M" )
85
+ .withDuration ("PT1M" )
86
86
)
87
87
);
88
88
89
89
assertNotNull (workflow );
90
90
assertNotNull (workflow .getStart ());
91
91
assertEquals (1 , workflow .getStates ().size ());
92
92
State state = workflow .getStates ().get (0 );
93
- assertTrue (state instanceof DelayState );
93
+ assertTrue (state instanceof SleepState );
94
94
assertNotNull (workflow .getFunctions ());
95
95
assertEquals (1 , workflow .getFunctions ().getFunctionDefs ().size ());
96
96
assertEquals ("testFunction" , workflow .getFunctions ().getFunctionDefs ().get (0 ).getName ());
@@ -115,19 +115,19 @@ public void testSingleEvent() {
115
115
.withOperation ("testSwaggerDef#testOperationId" )))
116
116
)
117
117
.withStates (Arrays .asList (
118
- new DelayState ().withName ("delayState" ).withType (DELAY )
118
+ new SleepState ().withName ("delayState" ).withType (SLEEP )
119
119
.withEnd (
120
120
new End ()
121
121
)
122
- .withTimeDelay ("PT1M" )
122
+ .withDuration ("PT1M" )
123
123
)
124
124
);
125
125
126
126
assertNotNull (workflow );
127
127
assertNotNull (workflow .getStart ());
128
128
assertEquals (1 , workflow .getStates ().size ());
129
129
State state = workflow .getStates ().get (0 );
130
- assertTrue (state instanceof DelayState );
130
+ assertTrue (state instanceof SleepState );
131
131
assertNotNull (workflow .getFunctions ());
132
132
assertEquals (1 , workflow .getFunctions ().getFunctionDefs ().size ());
133
133
assertEquals ("testFunction" , workflow .getFunctions ().getFunctionDefs ().get (0 ).getName ());
0 commit comments