Package org.mockserver.mock
Class ScenarioManager
- java.lang.Object
-
- org.mockserver.mock.ScenarioManager
-
public class ScenarioManager extends Object
-
-
Constructor Summary
Constructors Constructor Description ScenarioManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear(String scenarioName)Clears ALL isolation variants of the given scenario name.Map<String,String>getAllStates()Returns all states as a flat map of scenario name (or composite key toString) to state.Map<org.mockserver.mock.ScenarioManager.ScenarioKey,String>getAllStatesStructured()Returns all states as a map ofScenarioManager.ScenarioKeyto state string, suitable for programmatic access without relying on the display-oriented string format produced bygetAllStates().StringgetState(String scenarioName)StringgetState(String scenarioName, String isolation)booleanmatchesAndTransition(String scenarioName, String requiredState, String newState)booleanmatchesAndTransition(String scenarioName, String isolation, String requiredState, String newState)booleanmatchesState(String scenarioName, String requiredState)booleanmatchesState(String scenarioName, String isolation, String requiredState)voidreset()voidsetState(String scenarioName, String state)voidsetState(String scenarioName, String isolation, String state)voidtransitionState(String scenarioName, String newState)voidtransitionState(String scenarioName, String isolation, String newState)
-
-
-
Field Detail
-
STARTED
public static final String STARTED
- See Also:
- Constant Field Values
-
-
Method Detail
-
matchesAndTransition
public boolean matchesAndTransition(String scenarioName, String requiredState, String newState)
-
matchesState
public boolean matchesState(String scenarioName, String isolation, String requiredState)
-
matchesAndTransition
public boolean matchesAndTransition(String scenarioName, String isolation, String requiredState, String newState)
-
transitionState
public void transitionState(String scenarioName, String isolation, String newState)
-
clear
public void clear(String scenarioName)
Clears ALL isolation variants of the given scenario name. Both the legacy null-isolation key and any composite keys with the same scenario name are removed.
-
reset
public void reset()
-
getAllStates
public Map<String,String> getAllStates()
Returns all states as a flat map of scenario name (or composite key toString) to state. For backward compatibility, entries with null isolation return just the scenario name as key.Warning: The string format for composite-isolated keys (
"name[isolation]") is NOT a stable API — it is intended for display and logging only. For programmatic access, usegetAllStatesStructured().
-
getAllStatesStructured
public Map<org.mockserver.mock.ScenarioManager.ScenarioKey,String> getAllStatesStructured()
Returns all states as a map ofScenarioManager.ScenarioKeyto state string, suitable for programmatic access without relying on the display-oriented string format produced bygetAllStates().
-
-