Class MockServerClient.ScenarioHandle

java.lang.Object
org.mockserver.client.MockServerClient.ScenarioHandle
Enclosing class:
MockServerClient

public class MockServerClient.ScenarioHandle extends Object
Typed handle that wraps the scenario control-plane endpoints for a single named scenario.
  • Method Details

    • state

      public String state()
      Get the current state of this scenario via GET /mockserver/scenario/{name}.
      Returns:
      the current state, or null if the scenario has never had a state set
    • set

      Set this scenario's state via PUT /mockserver/scenario/{name}.
      Parameters:
      state - the new state
      Returns:
      this handle for chaining
    • set

      public MockServerClient.ScenarioHandle set(String state, Long transitionAfterMs, String nextState)
      Set this scenario's state and optionally schedule a timed transition to nextState via PUT /mockserver/scenario/{name}.
      Parameters:
      state - the new state
      transitionAfterMs - delay before transitioning to nextState, or null for none
      nextState - the state to transition to after transitionAfterMs, or null for none
      Returns:
      this handle for chaining
    • trigger

      public MockServerClient.ScenarioHandle trigger(String newState)
      Externally trigger a state transition via PUT /mockserver/scenario/{name}/trigger.
      Parameters:
      newState - the state to transition to
      Returns:
      this handle for chaining