Module com.roscopeco.moxy.core
Package com.roscopeco.moxy.api
Moxy's public API
By implementing the interfaces in this package, new Moxy backends can be created which use different generation, stubbing, verifying and matching implementations.
Most users won't use this API directly - usage will be via
the static methods on the Moxy
and
Matchers
classes.
See README.md for instructions on using the library.
-
Interface Summary Interface Description ClassDefinitionStrategy A class definition strategy is used to actually define a mock class.DefaultReturnGenerator Generates default return values for mocked methods.InvocationRunnable Functional interface used to run monitored void method invocations (e.g.InvocationSupplier<T> Functional interface used to run monitored method invocations (e.g.MoxyClassMockEngine An engine used to create Moxy class mocks.MoxyEngine A MoxyEngine is the class that is responsible for generating mocks according to whatever strategy it is designed to use.MoxyMatcher<T> A matcher provides argument-matching for Moxy mocks.MoxyMultiVerifier Implementations of this interface allow multiple mocks invocations to be verified after use.MoxyStubber<T> Implementations of this interface allow mocks to be stubbed to throw or return given values.MoxyVerifier Implementations of this interface allow mocks to be verified after use.MoxyVoidStubber Special case stubber for void methods. -
Class Summary Class Description LookupClassDefinitionStrategy AClassDefinitionStrategy
implementation that uses a suppliedMethodHandles.Lookup
. -
Exception Summary Exception Description InvalidMockInvocationException Thrown to indicate the framework was expecting to see a mock invocation (e.g.InvalidStubbingException Thrown to indicate an invocation has been incorrectly stubbed.MockGenerationException Thrown to indicate an unrecoverable error occured during mock generation.MonitoredInvocationException Thrown to indicate an unexpected occurred during a monitored invocation.MoxyException Base-class for Moxy exceptions. -
Annotation Types Summary Annotation Type Description MoxyMock All mocks created by aMoxyEngine
implementation must have this annotation.