Class InvocationExpectationBuilder

java.lang.Object
org.jmock.internal.InvocationExpectationBuilder
All Implemented Interfaces:
ExpectationCapture, MethodClause, ParametersClause, ReceiverClause

public class InvocationExpectationBuilder extends Object implements ExpectationCapture, ReceiverClause, MethodClause, ParametersClause
  • Field Details

    • expectation

      private final InvocationExpectation expectation
    • isFullySpecified

      private boolean isFullySpecified
    • needsDefaultAction

      private boolean needsDefaultAction
    • capturedParameterMatchers

      private List<org.hamcrest.Matcher<?>> capturedParameterMatchers
  • Constructor Details

    • InvocationExpectationBuilder

      public InvocationExpectationBuilder()
  • Method Details

    • toExpectation

      public Expectation toExpectation(Action defaultAction)
    • setCardinality

      public void setCardinality(Cardinality cardinality)
    • addParameterMatcher

      public void addParameterMatcher(org.hamcrest.Matcher<?> matcher)
    • addOrderingConstraint

      public void addOrderingConstraint(OrderingConstraint constraint)
    • addInSequenceOrderingConstraint

      public void addInSequenceOrderingConstraint(Sequence sequence)
    • setAction

      public void setAction(Action action)
    • addSideEffect

      public void addSideEffect(SideEffect sideEffect)
    • captureExpectedObject

      private <T> T captureExpectedObject(T mockObject)
    • asMockedType

      private <T> T asMockedType(T mockObject, Object capturingImposter)
    • createExpectationFrom

      public void createExpectationFrom(Invocation invocation)
      Specified by:
      createExpectationFrom in interface ExpectationCapture
    • checkParameterMatcherCount

      private void checkParameterMatcherCount(Invocation invocation)
    • checkWasFullySpecified

      public void checkWasFullySpecified()
    • of

      public <T> T of(T mockObject)
      Specified by:
      of in interface ReceiverClause
    • of

      public MethodClause of(org.hamcrest.Matcher<?> objectMatcher)
      Specified by:
      of in interface ReceiverClause
    • method

      public ParametersClause method(org.hamcrest.Matcher<Method> methodMatcher)
      Specified by:
      method in interface MethodClause
    • method

      public ParametersClause method(String nameRegex)
      Specified by:
      method in interface MethodClause
    • with

      public void with(org.hamcrest.Matcher<?>... parameterMatchers)
      Specified by:
      with in interface ParametersClause
    • withNoArguments

      public void withNoArguments()
      Specified by:
      withNoArguments in interface ParametersClause