Details
Description
The test in the code below passes:
public class ControlFailTest { static interface Foo { void foo(String s); } static interface Bar { void bar(String s); } @Test public void testControlFail() { IMocksControl control = EasyMock.createControl(); Foo foo = control.createMock(Foo.class); Bar bar = control.createMock(Bar.class); EasyMock.resetToNice(foo); control.replay(); bar.bar("I'm not allowed!"); control.verify(); } }
If I comment out the line which resets foo to nice, the test fails, as it should do.
foo and bar are linked to the same control. Resetting a mock means to reset its control.
So the behavior is expected. The control is resetted to nice.