public class ReturnsElementsOf extends java.lang.Object implements Answer
//this:
when(mock.foo()).thenReturn(1, 2, 3);
//is equivalent to:
when(mock.foo()).thenReturn(new ReturnsElementsOf(Arrays.asList(1, 2, 3)));
Constructor and Description |
---|
ReturnsElementsOf(java.util.Collection elements) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
answer(InvocationOnMock invocation) |
public java.lang.Object answer(InvocationOnMock invocation) throws java.lang.Throwable