1

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?

Yudhistira Arya
  • 3,491
  • 6
  • 25
  • 42
  • 1
    Reverse of this one ? http://stackoverflow.com/q/6565971/1686291 – Not a bug May 26 '16 at 11:49
  • Hi, thanks for your comment. I don't think that question is related to my question. It's more related to the [JMock States](http://www.jmock.org/states.html) functionality. – Yudhistira Arya Jun 05 '16 at 08:58

1 Answers1

1

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).

Rogério
  • 16,171
  • 2
  • 50
  • 63