Package org.mockito
Interface MockedConstruction<T>
- Type Parameters:
T
- The type for which the construction is being mocked.
- All Superinterfaces:
AutoCloseable
,ScopedMock
Represents a mock of any object construction of the represented type. Within the scope of the
mocked construction, the invocation of any interceptor will generate a mock which will be
prepared as specified when generating this scope. The mock can also be received via this
instance.
If the Mock
annotation is used on fields or method parameters of this type, a mocked
construction is created instead of a regular mock. The mocked construction is activated and
released upon completing any relevant test.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
The context for a construction mock.static interface
Functional interface that consumes a newly created mock and the mock context. -
Method Summary
Methods inherited from interface org.mockito.ScopedMock
close, closeOnDemand, isClosed
-
Method Details
-
constructed
Get the constructed mocks.- Returns:
- the constructed mocks.
-