Class Stub


public class Stub extends Object

Stub is not responsible for decision whether to execute action or not (e.g. when request matches `XXX` - do `YYY`)

Just a wrapper for the Action which will should be performed when Condition is true.

See Also:
  • Constructor Details

  • Method Details

    • alsoWhen

      public Stub alsoWhen(Condition extraCondition)
      Appends an extra condition to the stub.
    • withExtraAction

      public Stub withExtraAction(Applicable extraAction)
      Appends an extra action to the stub
    • withSequenceItem

      public Stub withSequenceItem(Applicable nextWhat)
    • isApplicable

      public boolean isApplicable(Call call)
      Checks whether the call satisfies condition of this stub
    • apply

      public org.glassfish.grizzly.http.server.Response apply(org.glassfish.grizzly.http.server.Response response)
      Executes all actions against the response.
    • withAction

      public Stub withAction(Applicable action)
    • withActionSequence

      public Stub withActionSequence(List<Applicable> actionSequence)
    • withExceededAction

      public Stub withExceededAction(Applicable exceededAction)
    • getAppliedTimes

      public int getAppliedTimes()
    • setExpectedTimes

      public void setExpectedTimes(int expectedTimes)
    • setExpectSequenceCompleted

      public void setExpectSequenceCompleted(Boolean expectSequenceCompleted)
    • getActionSequence

      public List<Applicable> getActionSequence()
    • getExpectSequenceCompleted

      public Boolean getExpectSequenceCompleted()
    • getExpectedTimes

      public int getExpectedTimes()
      Get how many times stub expected to be called
    • toString

      public String toString()
      toString in class Object
    • withLabel

      public Stub withLabel(String label)