See: Description
Interface | Description |
---|---|
Delegate<T> |
An empty interface to be used with the
Expectations.result field or the
Invocations#with(Delegate) method, allowing test code
to freely define invocation results or argument matching rules, respectively. |
Class | Description |
---|---|
Deencapsulation |
Provides utility methods that enable access to ("de-encapsulate") otherwise non-accessible fields, methods and
constructors.
|
Expectations |
Used to record strict expectations on mocked types and mocked instances.
|
FullVerifications |
Same as
Verifications , but checking that all invocations from code under test are explicitly
verified, except for those already verified through other means. |
FullVerificationsInOrder |
A combination of
FullVerifications and VerificationsInOrder . |
Invocation |
A context object representing the current invocation to a mocked method/constructor, to be passed as the
first parameter of the corresponding mock method implementation.
|
MockUp<T> |
A base class used in the creation of a mock-up for a class or interface.
|
NonStrictExpectations |
Used to record non-strict expectations on mocked types and mocked instances.
|
Verifications |
Used to verify a set of non-strict expectations on available mocked types and/or
instances, against the invocations which actually occurred during the test.
|
VerificationsInOrder |
Same as
Verifications , but checking that invocations from code under test occurred in the same order as the
verified expectations. |
Annotation Type | Description |
---|---|
Capturing |
Indicates a mock field or a mock parameter for which all classes extending/implementing the mocked type will
also get mocked.
|
Cascading |
Indicates a mocked type where the return types of mocked methods get automatically
mocked if and when an invocation to the method occurs, with a mocked instance being returned instead of
null . |
Injectable |
This annotation can be applied to a mock field or a mock parameter, by itself or in combination with
@Mocked . |
Mock |
Used inside a mock-up class to indicate a mock method whose implementation will
temporarily replace the implementation of a matching "real" method.
|
Mocked |
This annotation can be applied to instance fields of a test class, and to parameters of test methods.
|
Tested |
Indicates a class to be tested in isolation from selected dependencies, with optional automatic instantiation and/or
automatic injection of dependencies.
|
UsingMocksAndStubs | Deprecated
Apply the desired mock-up classes in a
@BeforeClass method instead. |
Expectations
class provides an API for the traditional record-replay model of recording
expected invocations which are later replayed and implicitly verified.
This API makes use of the Mocked
annotation.
The Verifications
class, when combined with the NonStrictExpectations
class, extends
the record-replay model to a record-replay-verify model, where the record phase can be left empty, with
expected invocations verified explicitly after exercising the code under test (ie, after the replay phase).
The MockUp<T>
generic class (where T
is the mocked type) allows
the definition of fake implementations for arbitrary classes.Copyright © 2006-2014. All Rights Reserved.