Class StateMachineTestPlanBuilder.StateMachineTestPlanStepBuilder
java.lang.Object
org.springframework.statemachine.test.StateMachineTestPlanBuilder.StateMachineTestPlanStepBuilder
- Enclosing class:
- StateMachineTestPlanBuilder<S,
E>
Builder for individual plan steps.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionand()
Add a new step and returnStateMachineTestPlanBuilder
for chaining.expectEventNotAccepted
(int count) Expect event not accepter happeningcount
times.expectExtendedStateChanged
(int count) Expect state machine extended state variables changingcount
times.expectState
(S state) Expect a stateS
.expectStateChanged
(int count) Expect state changed happeningcount
times.expectStateEntered
(int count) Expect state enter happeningcount
times.expectStateEntered
(S... states) Expect states entered in order given.expectStateExited
(int count) Expect state exit happeningcount
times.expectStateExited
(S... states) Expect states exited in order given.expectStateMachineStarted
(int count) Expect state machine start happeningcount
times.expectStateMachineStopped
(int count) Expect state machine stop happeningcount
times.expectStates
(S... states) Expect a statesS
.expectTransition
(int count) Expect transition happeningcount
times.expectTransitionEnded
(int count) Expect transition end happeningcount
times.expectTransitionStarted
(int count) Expect transition start happeningcount
times.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 eventE
into 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
. IfsendToAll
is set toTRUE
event 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
. IfsendToAll
is set toTRUE
event will be send to all existing machines. IfsendPalallel
is set toTRUE
event 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 eventE
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
-
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>
. IfsendToAll
is set toTRUE
event 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 happeningcount
times.- 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 happeningcount
times.- Parameters:
count
- the count- Returns:
- the state machine test plan step builder
-
expectStateExited
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectStateExited(int count) Expect state exit happeningcount
times.- 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 happeningcount
times.- Parameters:
count
- the count- Returns:
- the state machine test plan step builder
-
expectTransition
Expect transition happeningcount
times.- Parameters:
count
- the count- Returns:
- the state machine test plan step builder
-
expectTransitionStarted
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectTransitionStarted(int count) Expect transition start happeningcount
times.- Parameters:
count
- the count- Returns:
- the state machine test plan step builder
-
expectTransitionEnded
public StateMachineTestPlanBuilder<S,E>.StateMachineTestPlanStepBuilder expectTransitionEnded(int count) Expect transition end happeningcount
times.- 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 happeningcount
times.- 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 happeningcount
times.- 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 changingcount
times.- Parameters:
count
- the count- Returns:
- the state machine test plan step builder
-
and
Add a new step and returnStateMachineTestPlanBuilder
for chaining.- Returns:
- the state machine test plan builder for chaining
-