Files
spring-soap/spring-state-machine/src/test/java/com/baeldung/spring/statemachine/JunctionStateMachineTest.java
Grzegorz Piwowarek 85969c69d2 State machine refactor (#1520)
* State machine refactor

* Add surefire plugin

* Refactor
2017-03-28 08:17:00 +02:00

24 lines
849 B
Java

package com.baeldung.spring.statemachine;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.statemachine.StateMachine;
public class JunctionStateMachineTest {
@Test
public void whenTransitioningToJunction_thenArriveAtSubJunctionNode() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(com.baeldung.spring.statemachine.config.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());
}
}