6
Tôi đang cố gắng tìm ra cách hoạt động của org.mockito.AdditionalMatchers
nhưng không thành công. Tại sao thử nghiệm này lại thất bại?Tôi nên sử dụng org.mockito.AdditionalMatchers.gt như thế nào?
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))
);
}
}
Output là:
java.lang.AssertionError:
Expected: is <0>
got: <17>