public class ReturnsDeepStubs extends java.lang.Object implements Answer<java.lang.Object>, java.io.Serializable
Supports nested generic information, with this answer you can write code like this :
interface GenericsNest<K extends Comparable<K> & Cloneable> extends Map<K, Set<Number>> {}
GenericsNest<?> mock = mock(GenericsNest.class, new ReturnsGenericDeepStubs());
Number number = mock.entrySet().iterator().next().getValue().iterator().next();
Constructor and Description |
---|
ReturnsDeepStubs() |
Modifier and Type | Method and Description |
---|---|
protected GenericMetadataSupport |
actualParameterizedType(java.lang.Object mock) |
java.lang.Object |
answer(InvocationOnMock invocation) |
public java.lang.Object answer(InvocationOnMock invocation) throws java.lang.Throwable
protected GenericMetadataSupport actualParameterizedType(java.lang.Object mock)