Java: Respect Hamcrest assertThat(X, notNullValue())

This commit is contained in:
Robin Neatherway
2019-10-24 16:15:50 +01:00
parent 692c29d095
commit 84202ff2e1
9 changed files with 106 additions and 23 deletions

View File

@@ -1,6 +1,8 @@
import java.util.Iterator;
import java.util.List;
import static org.junit.Assert.*;
import static org.hamcrest.core.IsNull.*;
import static org.hamcrest.MatcherAssert.*;
public class A {
public void notTest() {
@@ -296,6 +298,12 @@ public class A {
for (it = iter.iterator(); !!it.hasNext(); ) {}
}
public void assertThatTest() {
Object assertThat_ok1 = maybe() ? null : new Object();
assertThat(assertThat_ok1, notNullValue());
assertThat_ok1.toString();
}
private boolean m;
A(boolean m) {
this.m = m;