Package com.google.common.truth
Class TruthJUnit
java.lang.Object
com.google.common.truth.TruthJUnit
Truth - a proposition framework for tests, supporting JUnit style
assertion and assumption semantics in a fluent style.
TruthJUnit contains a junit-specific "failure strategy" known as an
assumption. An assumption is a proposition that, if the proposition is
false, aborts (skips) the test. This is especially useful in JUnit
theories or parameterized tests, or other combinatorial tests where
some subset of the combinations are simply not applicable for testing.
TruthJUnit is the entry point for assumptions, via the
assume()
method.
eg:
import com.google.common.truth.Truth.assert_;
import com.google.common.truth.Truth.assume;
public void @Test testFoosAgainstBars {
assume().that(foo).isNotNull();
assume().that(bar).isNotNull();
assert_().that(foo.times(bar)).isEqualTo(blah);
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
THROW_ASSUMPTION_ERROR
-
ASSUME
-
-
Constructor Details
-
TruthJUnit
private TruthJUnit()
-
-
Method Details
-
assume
-