Class StateMachineTestPlanBuilder.StateMachineTestPlanStepBuilder
java.lang.Object
org.springframework.statemachine.test.StateMachineTestPlanBuilder.StateMachineTestPlanStepBuilder
- Enclosing class:
- StateMachineTestPlanBuilder<S,
E>
Builder for individual plan steps.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()Add a new step and returnStateMachineTestPlanBuilderfor chaining.expectEventNotAccepted(int count) Expect event not accepter happeningcounttimes.expectExtendedStateChanged(int count) Expect state machine extended state variables changingcounttimes.expectState(S state) Expect a stateS.expectStateChanged(int count) Expect state changed happeningcounttimes.expectStateEntered(int count) Expect state enter happeningcounttimes.expectStateEntered(S... states) Expect states entered in order given.expectStateExited(int count) Expect state exit happeningcounttimes.expectStateExited(S... states) Expect states exited in order given.expectStateMachineStarted(int count) Expect state machine start happeningcounttimes.expectStateMachineStopped(int count) Expect state machine stop happeningcounttimes.expectStates(S... states) Expect a statesS.expectTransition(int count) Expect transition happeningcounttimes.expectTransitionEnded(int count) Expect transition end happeningcounttimes.expectTransitionStarted(int count) Expect transition start happeningcounttimes.expectVariable(Object key) Expect variable to exist in extended state variables.expectVariable(Object key, Object value) Expect variable to exist in extended state variables and match with the value.expectVariableWith(org.hamcrest.Matcher<Map<? extends Object, ?>> matcher) Expect variable map with hamcrestMatcher.Send an eventE.Send an eventE.Send an eventE.Send an eventEinto a state machine identified bymachineId.Send a messageMessage<E>.Send a messageMessage<E>.Send a messageMessage<E>into a state machine identified bymachineId.
-
Constructor Details
-
StateMachineTestPlanStepBuilder
public StateMachineTestPlanStepBuilder()
-
-
Method Details
-
expectState
Expect a stateS.- Parameters:
state- the state- Returns:
- the state machine test plan step builder
-
expectStates
Expect a statesS.- Parameters:
states- the states- Returns:
- the state machine test plan step builder
-
sendEvent
Send an eventE. In case multiple state machines exists, a random one will be chosen to send this event. Multiple events can be defined which are then send in defined order.- Parameters:
event- the event- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(E event, boolean sendToAll) Send an eventE. IfsendToAllis set toTRUEevent will be send to all existing machines. Multiple events can be defined which are then send in defined order.- Parameters:
event- the eventsendToAll- send to all machines- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(E event, boolean sendToAll, boolean sendParallel) Send an eventE. IfsendToAllis set toTRUEevent will be send to all existing machines. IfsendPalallelis set toTRUEevent to all machines will be send by parallel threads. Multiple events can be defined which are then send in defined order.- Parameters:
event- the eventsendToAll- send to all machinessendParallel- send event parallel- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(E event, Object machineId) Send an eventEinto a state machine identified bymachineId. Multiple events can be defined which are then send in defined order.- Parameters:
event- the eventmachineId- the machine identifier for sending event- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(org.springframework.messaging.Message<E> event) Send a messageMessage<E>. In case multiple state machines exists, a random one will be chosen to send this event. Multiple events can be defined which are then send in defined order.- Parameters:
event- the event- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(org.springframework.messaging.Message<E> event, boolean sendToAll) Send a messageMessage<E>. IfsendToAllis set toTRUEevent will be send to all existing machines.Multiple events can be defined which are then send in defined order.- Parameters:
event- the eventsendToAll- send to all machines- Returns:
- the state machine test plan step builder
-
sendEvent
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder sendEvent(org.springframework.messaging.Message<E> event, Object machineId) Send a messageMessage<E>into a state machine identified bymachineId. Multiple events can be defined which are then send in defined order.- Parameters:
event- the eventmachineId- the machine identifier for sending event- Returns:
- the state machine test plan step builder
-
expectVariable
Expect variable to exist in extended state variables.- Parameters:
key- the key- Returns:
- the state machine test plan step builder
-
expectVariableWith
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectVariableWith(org.hamcrest.Matcher<Map<? extends Object, ?>> matcher) Expect variable map with hamcrestMatcher.- Parameters:
matcher- the matcher- Returns:
- the state machine test plan step builder
-
expectVariable
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectVariable(Object key, Object value) Expect variable to exist in extended state variables and match with the value.- Parameters:
key- the keyvalue- the value- Returns:
- the state machine test plan step builder
-
expectStateChanged
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateChanged(int count) Expect state changed happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectStateEntered
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateEntered(S... states) Expect states entered in order given.- Parameters:
states- the states entered- Returns:
- the state machine test plan step builder
-
expectStateExited
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateExited(S... states) Expect states exited in order given.- Parameters:
states- the states exited- Returns:
- the state machine test plan step builder
-
expectStateEntered
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateEntered(int count) Expect state enter happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectStateExited
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateExited(int count) Expect state exit happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectEventNotAccepted
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectEventNotAccepted(int count) Expect event not accepter happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectTransition
Expect transition happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectTransitionStarted
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectTransitionStarted(int count) Expect transition start happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectTransitionEnded
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectTransitionEnded(int count) Expect transition end happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectStateMachineStarted
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateMachineStarted(int count) Expect state machine start happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectStateMachineStopped
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateMachineStopped(int count) Expect state machine stop happeningcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
expectExtendedStateChanged
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectExtendedStateChanged(int count) Expect state machine extended state variables changingcounttimes.- Parameters:
count- the count- Returns:
- the state machine test plan step builder
-
and
Add a new step and returnStateMachineTestPlanBuilderfor chaining.- Returns:
- the state machine test plan builder for chaining
-