Apply hard-coded contract to TestVerb.that

… to support TestVerb-returning methods like TruthJUnit4.assume,
Truth.assert_, and Truth.assertWithMessage, in statements like
assume().that(…).isNotNull().

Change-Id: Idbb1e9cfe6e58b067577fffc4ed301807ebbab9d
This commit is contained in:
Dana Dahlstrom
2016-07-18 18:59:38 -07:00
parent d641aa1d2e
commit 9ab16ef854
3 changed files with 13 additions and 1 deletions
@@ -1,6 +1,7 @@
import org.jetbrains.annotations.Nullable;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;
class Contracts {
@@ -9,4 +10,8 @@ class Contracts {
System.out.println(o.hashCode());
}
private void assumeNotNullValue(@Nullable Object o) {
assume().that(o).isNotNull();
System.out.println(o.hashCode());
}
}