Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mockito deep stubs for nested objects
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private NestedObject nestedObject;

example usage in a test method:

when(nestedObject.getStatusInfo().getValue().getStatus()).thenReturn(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment