Package org.mockserver.client
Class MockServerClient.ScenarioHandle
java.lang.Object
org.mockserver.client.MockServerClient.ScenarioHandle
- Enclosing class:
- MockServerClient
Typed handle that wraps the scenario control-plane endpoints for a single named scenario.
-
Method Summary
Modifier and TypeMethodDescriptionSet this scenario's state viaPUT /mockserver/scenario/{name}.Set this scenario's state and optionally schedule a timed transition tonextStateviaPUT /mockserver/scenario/{name}.state()Get the current state of this scenario viaGET /mockserver/scenario/{name}.Externally trigger a state transition viaPUT /mockserver/scenario/{name}/trigger.
-
Method Details
-
state
Get the current state of this scenario viaGET /mockserver/scenario/{name}.- Returns:
- the current state, or
nullif the scenario has never had a state set
-
set
Set this scenario's state viaPUT /mockserver/scenario/{name}.- Parameters:
state- the new state- Returns:
- this handle for chaining
-
set
Set this scenario's state and optionally schedule a timed transition tonextStateviaPUT /mockserver/scenario/{name}.- Parameters:
state- the new statetransitionAfterMs- delay before transitioning tonextState, ornullfor nonenextState- the state to transition to aftertransitionAfterMs, ornullfor none- Returns:
- this handle for chaining
-
trigger
Externally trigger a state transition viaPUT /mockserver/scenario/{name}/trigger.- Parameters:
newState- the state to transition to- Returns:
- this handle for chaining
-