assertEquals("bar", readObject.simpleMethod(2));
}
@Test
public void should_verify_call_order_for_serialized_mock() throws Exception {
IMethods mock = mock(IMethods.class, withSettings().serializable());
IMethods mock2 = mock(IMethods.class, withSettings().serializable());
mock.arrayReturningMethod();
mock2.arrayReturningMethod();
// when
ByteArrayOutputStream serialized = serializeMock(mock);
ByteArrayOutputStream serialized2 = serializeMock(mock2);
// then
IMethods readObject = deserializeMock(serialized, IMethods.class);
IMethods readObject2 = deserializeMock(serialized2, IMethods.class);
InOrder inOrder = inOrder(readObject, readObject2);
inOrder.verify(readObject).arrayReturningMethod();
inOrder.verify(readObject2).arrayReturningMethod();
}