I user TestNG and jMock for my unit test but, I have a problem with TestNG. It marks the test as passed when I expect mock object method to be invoked and it is not!
public class SomeTestTest {
Mockery mocker = new Mockery();
SomeInterface someInterface = mocker.mock(SomeInterface.class);
@Test
public void testName() throws Exception {
mocker.checking(new Expectations() {{
oneOf(someInterface).someMethod();
}});
}
}
and this is the report I get
Custom suite
Total tests run: 1, Failures: 0, Skips: 0