Package org.spockframework.mock
Spock's built-in mocking framework.
-
Interface Summary Interface Description IArgumentConstraint A constraint on an invocation argument.IChainableResponseGenerator Generates return values for invocations on mock objects.IDefaultResponse A strategy for responding to unexpected method calls.IInteractionAware IInteractionScope An interaction scope holds a group of interactions that will be verified, and thereafter removed, at the same time.IInvocationConstraint IMockConfiguration Configuration options for mock objects.IMockController IMockFactory IMockInteraction An anticipated interaction between the SUT and one or more mock objects.IMockInvocation A method invocation on a mock object.IMockMethod Represents a method that can be mocked.IMockObject IResponseGenerator Generates responses to mock invocations.ISpockMockObject Marker-like interface implemented by all mock objects that allowsMockDetector
to detect mock objects. -
Class Summary Class Description CallRealMethodResponse A response strategy that delegates method calls to the real object underlying the mock (if any).DefaultEqualsHashCodeToStringInteractions EmptyOrDummyResponse A response strategy that returns zero, an "empty" object, or a "dummy" object, depending on the method's declared return type.MockDetector Detects mock objects and provides information about them.ZeroOrNullResponse A response strategy that returns zero, false, or null, depending on the method's return type. -
Enum Summary Enum Description MockImplementation Determines how method calls are processed and matched against interactions.MockNature A named set of defaults for a mock's configuration options. -
Exception Summary Exception Description CannotCreateMockException Thrown to indicate a problem when creating a mock object.CannotInvokeRealMethodException Thrown to indicate that an attempt was made to delegate a method call to a real object underlying a mock, although no such underlying object exists. -
Error Summary Error Description InteractionNotSatisfiedError Base class for exceptions thrown to indicate that one or more interactions were not satisfied.TooFewInvocationsError Thrown to indicate that one or more mandatory interactions matched too few invocations.TooManyInvocationsError Thrown to indicate that a mandatory interaction matched too many invocations.WrongInvocationOrderError Thrown if an invocation on a mock object occurs too late.