6
org.mockito.AdditionalMatchers
の仕組みを理解しようとしていますが、失敗しました。なぜこのテストは失敗しますか?org.mockito.AdditionalMatchers.gtの使用方法を教えてください。
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>