JMockit
is not returning the Integer
set as the return value in an expectation.
public interface Foo {
Integer getInt();
}
@Test
public void test(@Mocked final Foo foo) {
final Integer anyInt = 3;
new Expectations() {{
foo.getInt(); result = anyInt;
}};
assertThat(foo.getInt(), equalTo(anyInt));
}
fails with message:
java.lang.AssertionError:
Expected: <3>
but: was <0>
Any idea why?
JMockit 1.14
Thanks