public class ReturnsDeepStubs extends Object implements Answer<Object>, 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(Object mock) |
Object |
answer(InvocationOnMock invocation) |
public Object answer(InvocationOnMock invocation) throws Throwable
protected GenericMetadataSupport actualParameterizedType(Object mock)