In mockito we are able to spy on real instance as in:
List<String> list = new LinkedList<>();
List<String> spy = spy(list);
spy.add("one");
verify(spy).add("one");
What would be the equivalent of spy functionality in jmock 2?
In mockito we are able to spy on real instance as in:
List<String> list = new LinkedList<>();
List<String> spy = spy(list);
spy.add("one");
verify(spy).add("one");
What would be the equivalent of spy functionality in jmock 2?
Mockito's "spies" are also known as "partial" mocks. jMock, however, has no support for partial mocking or "spying". (At least, I couldn't find anything of the sort in jMock's API documentation).