I have a class under test with jmock and I was making a change to it and expecting it to fail but it didn't. Before my change I had a alert() method that was getting called as expected and the test was passing. After I made the change my alert() method should no longer get called, however the unit test continued working! I checked it by putting a breakpoint and stepping through and it in fact does NOT call alert(), however jmock seems to think it does. Any ideas on how to figure out what's going on here?
Mockery context = new Mockery();
final NotifierInterface notifier = context.mock(NotifierInterface.class);
context.checking(new Expectations() {{
oneOf(notifier).alert(with(any(String.class)));
...
}
analyzer = new Analyzer(notifier);
analyzer.run();
Thanks!