我试图弄清楚如何org.mockito.AdditionalMatchers
工作,但我失败了。为什么这个测试失败了?
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
import static org.mockito.AdditionalMatchers.*;
public class DemoTest {
@Test
public void testGreaterThan() throws Exception {
assertThat( 17
, is( gt( 10 ) )
);
}
}
输出是:
java.lang.AssertionError:
Expected: is <0>
got: <17>