理由はわかりませんが、私はいつも JMock テストを次のように書いてきました。
@Test
public void testMyThing() throws Exception {
mockery.checking(new Expectations() {{
oneOf(mockObj).foo();
}});
testObj.bar(); // calls mockObj.foo()
mockery.assertIsSatisfied();
}
しかし、多くのテストがある場合は、分解に移行assertIsSatisfied
した方がよいでしょうか?
@After
public void tearDown() throws Exception {
mockery.assertIsSatisfied();
}