- Enclosing class:
- GenericTestUtils
public static class GenericTestUtils.DelegateAnswer
extends Object
An Answer implementation that simply forwards all calls through
to a delegate.
This is useful as the default Answer for a mock object, to create
something like a spy on an RPC proxy. For example:
NamenodeProtocol origNNProxy = secondary.getNameNode();
NamenodeProtocol spyNNProxy = Mockito.mock(NameNodeProtocol.class,
new DelegateAnswer(origNNProxy);
doThrow(...).when(spyNNProxy).getBlockLocations(...);
...