Class GivenWhen.Phase

Enclosing class:
GivenWhen<SELF extends GivenWhen<SELF,ASSERT>,ASSERT extends Then<ASSERT,SELF>>

public static final class GivenWhen.Phase extends GivenWhen<GivenWhen.Phase,Then.Phase>
Default implementation of the GivenWhen.
  • Field Details

  • Constructor Details

    • Phase

      public Phase()
  • Method Details

    • initialize

      protected void initialize(WorkflowTestFixture<?,?> fixture, WorkflowTestDriver testDriver)
      Initializes this phase with the owning fixture and the shared test driver.

      The fixture calls this during construction so both phases operate on the same underlying workflow runtime and testing state.

      Parameters:
      fixture - owning workflow test fixture
      testDriver - shared workflow test driver
    • executionExists

      public GivenWhen.Phase executionExists()
      Waits until any active workflow execution exists.
      Returns:
      this phase for fluent chaining
    • executionExists

      public GivenWhen.Phase executionExists(Predicate<WorkflowExecution> predicate)
      Waits until an active workflow execution matching the predicate exists.

      If exactly one execution matches, it becomes the selected execution for subsequent assertions.

      Parameters:
      predicate - predicate used to select matching executions
      Returns:
      this phase for fluent chaining
    • historyExists

      public GivenWhen.Phase historyExists(Predicate<WorkflowHistory> predicate)
      Waits until a workflow history matching the predicate exists.

      If exactly one history matches, it becomes the selected history for subsequent assertions.

      Parameters:
      predicate - predicate used to select matching histories
      Returns:
      this phase for fluent chaining
    • historyExists

      public GivenWhen.Phase historyExists(String workflowId)
      Waits until a workflow history exists for the given workflow id.
      Parameters:
      workflowId - workflow id to find
      Returns:
      this phase for fluent chaining
    • historyExists

      public GivenWhen.Phase historyExists(WorkflowStatus workflowStatus)
      Waits until at least one workflow history exists and has the given status.
      Parameters:
      workflowStatus - expected workflow status
      Returns:
      this phase for fluent chaining
    • noExecution

      public GivenWhen.Phase noExecution()
      Asserts that no active workflow execution is present.
      Returns:
      this phase for fluent chaining
    • noHistory

      public GivenWhen.Phase noHistory()
      Asserts that no workflow history is recorded.
      Returns:
      this phase for fluent chaining
    • stop

      public void stop()
      Shuts down the test driver and all services.