Getting exception from EasyMock's “nice mock” with a debugger attached
问题 (Disclaimer - EasyMock newb) According to the documentation (and this post), if I wanted to use EasyMock to generate stub objects, I should use EasyMock.createNiceMock() . A "nice mock" is actually a stub - i.e an object that doesn't participate in validation, just returns values. However, the following snippet fails for me with an IllegalStateException("missing behavior definition for the preceding method") , on the second foo.translate() line. Foo foo = EasyMock.createNiceMock(Foo.class);