Spring State Machine (#1493)
* Neo4j cleanup * Neo4j cleanup * Neo4j cleanup x2 * State Machine Init * cleanup * White background, Java Util Logging * Change to Logging * Static import of asserts. rename test methods * fix attempt for S3 -> S4 * Remove awaitility. add teardown * fix attempt for S3 -> S4 * fix attempt for S3 -> S4 Final
This commit is contained in:
committed by
Zeger Hendrikse
parent
365d75a8d7
commit
1c1c557a39
@@ -0,0 +1,24 @@
|
||||
package com.baeldung.spring.stateMachine;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.statemachine.StateMachine;
|
||||
|
||||
import com.baeldung.spring.stateMachine.config.JunctionStateMachineConfiguration;
|
||||
|
||||
public class JunctionStateMachineTest {
|
||||
|
||||
@Test
|
||||
public void whenTransitioningToJunction_thenArriveAtSubJunctionNode() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(JunctionStateMachineConfiguration.class);
|
||||
StateMachine stateMachine = ctx.getBean(StateMachine.class);
|
||||
stateMachine.start();
|
||||
|
||||
stateMachine.sendEvent("E1");
|
||||
Assert.assertEquals("low", stateMachine.getState().getId());
|
||||
|
||||
stateMachine.sendEvent("end");
|
||||
Assert.assertEquals("SF", stateMachine.getState().getId());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user