Class ReturnsDeepStubs
java.lang.Object
org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs
- All Implemented Interfaces:
Serializable
,Answer<Object>
Returning deep stub implementation.
Will return previously created mock if the invocation matches.
Supports nested generic information, with this answer you can write code like this :
interface GenericsNest<K extends Comparable<K> invalid input: '&' Cloneable> extends Map<K, Set<Number>> {}
GenericsNest<?> mock = mock(GenericsNest.class, new ReturnsGenericDeepStubs());
Number number = mock.entrySet().iterator().next().getValue().iterator().next();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected GenericMetadataSupport
answer
(InvocationOnMock invocation)