2525import io .serverlessworkflow .api .produce .ProduceEvent ;
2626import io .serverlessworkflow .api .schedule .Schedule ;
2727import io .serverlessworkflow .api .start .Start ;
28- import io .serverlessworkflow .api .states .DelayState ;
28+ import io .serverlessworkflow .api .states .SleepState ;
2929import io .serverlessworkflow .api .workflow .Events ;
3030import io .serverlessworkflow .api .workflow .Functions ;
3131import org .junit .jupiter .api .Test ;
3232
3333import java .util .Arrays ;
3434
35- import static io .serverlessworkflow .api .states .DefaultState .Type .DELAY ;
35+ import static io .serverlessworkflow .api .states .DefaultState .Type .SLEEP ;
3636import static org .junit .jupiter .api .Assertions .*;
3737
3838public class WorkflowToMarkupTest {
@@ -44,22 +44,22 @@ public void testSingleState() {
4444 new Schedule ().withInterval ("PT1S" )
4545 ))
4646 .withStates (Arrays .asList (
47- new DelayState ().withName ("delayState " ).withType (DELAY )
47+ new SleepState ().withName ("sleepState " ).withType (SLEEP )
4848 .withEnd (
4949 new End ().withTerminate (true ).withCompensate (true )
5050 .withProduceEvents (Arrays .asList (
5151 new ProduceEvent ().withEventRef ("someEvent" )
5252 ))
5353 )
54- .withTimeDelay ("PT1M" )
54+ .withDuration ("PT1M" )
5555 )
5656 );
5757
5858 assertNotNull (workflow );
5959 assertNotNull (workflow .getStart ());
6060 assertEquals (1 , workflow .getStates ().size ());
6161 State state = workflow .getStates ().get (0 );
62- assertTrue (state instanceof DelayState );
62+ assertTrue (state instanceof SleepState );
6363 assertNotNull (state .getEnd ());
6464
6565 assertNotNull (Workflow .toJson (workflow ));
@@ -78,19 +78,19 @@ public void testSingleFunction() {
7878 .withOperation ("testSwaggerDef#testOperationId" )))
7979 )
8080 .withStates (Arrays .asList (
81- new DelayState ().withName ("delayState" ).withType (DELAY )
81+ new SleepState ().withName ("delayState" ).withType (SLEEP )
8282 .withEnd (
8383 new End ()
8484 )
85- .withTimeDelay ("PT1M" )
85+ .withDuration ("PT1M" )
8686 )
8787 );
8888
8989 assertNotNull (workflow );
9090 assertNotNull (workflow .getStart ());
9191 assertEquals (1 , workflow .getStates ().size ());
9292 State state = workflow .getStates ().get (0 );
93- assertTrue (state instanceof DelayState );
93+ assertTrue (state instanceof SleepState );
9494 assertNotNull (workflow .getFunctions ());
9595 assertEquals (1 , workflow .getFunctions ().getFunctionDefs ().size ());
9696 assertEquals ("testFunction" , workflow .getFunctions ().getFunctionDefs ().get (0 ).getName ());
@@ -115,19 +115,19 @@ public void testSingleEvent() {
115115 .withOperation ("testSwaggerDef#testOperationId" )))
116116 )
117117 .withStates (Arrays .asList (
118- new DelayState ().withName ("delayState" ).withType (DELAY )
118+ new SleepState ().withName ("delayState" ).withType (SLEEP )
119119 .withEnd (
120120 new End ()
121121 )
122- .withTimeDelay ("PT1M" )
122+ .withDuration ("PT1M" )
123123 )
124124 );
125125
126126 assertNotNull (workflow );
127127 assertNotNull (workflow .getStart ());
128128 assertEquals (1 , workflow .getStates ().size ());
129129 State state = workflow .getStates ().get (0 );
130- assertTrue (state instanceof DelayState );
130+ assertTrue (state instanceof SleepState );
131131 assertNotNull (workflow .getFunctions ());
132132 assertEquals (1 , workflow .getFunctions ().getFunctionDefs ().size ());
133133 assertEquals ("testFunction" , workflow .getFunctions ().getFunctionDefs ().get (0 ).getName ());
0 commit comments