How does one verify state for a mock object?
问题 I have a program Foo that runs on a device and first calls method1() and then method2() on an external module Bar. When both are called, then in response, Bar calls request() on Foo. To mock Bar, it has a reference to Foo and a method call_Request() which calls foo.request() // in class BarTest @Test public void barFlow() { InOrder inOrder = inOrder(mockBar); inOrder.verify(mockBar).method1(anyInt()); inOrder.verify(mockBar).method2(); // what to put as 'thenCallMethod'? when(mockBar.method2(