Class ScenarioManager


  • public class ScenarioManager
    extends Object
    • Constructor Detail

      • ScenarioManager

        public ScenarioManager()
    • Method Detail

      • getState

        public String getState​(String scenarioName)
      • setState

        public void setState​(String scenarioName,
                             String state)
      • matchesState

        public boolean matchesState​(String scenarioName,
                                    String requiredState)
      • matchesAndTransition

        public boolean matchesAndTransition​(String scenarioName,
                                            String requiredState,
                                            String newState)
      • transitionState

        public void transitionState​(String scenarioName,
                                    String newState)
      • setState

        public void setState​(String scenarioName,
                             String isolation,
                             String state)
      • 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, use getAllStatesStructured().

      • getAllStatesStructured

        public Map<org.mockserver.mock.ScenarioManager.ScenarioKey,​String> getAllStatesStructured()
        Returns all states as a map of ScenarioManager.ScenarioKey to state string, suitable for programmatic access without relying on the display-oriented string format produced by getAllStates().