Package | Description |
---|---|
com.google.common.truth |
Truth is an open source, fluent testing framework for Java that is designed to make your test
assertions and failure messages more readable.
|
Modifier and Type | Class and Description |
---|---|
class |
Expect
A
TestRule that batches up all failures encountered during a test, and reports them all
together at the end (similar to ErrorCollector ). |
Modifier and Type | Method and Description |
---|---|
static StandardSubjectBuilder |
Truth.assert_()
Begins a call chain with the fluent Truth API.
|
static StandardSubjectBuilder |
Truth.assertWithMessage(String messageToPrepend)
Returns a
StandardSubjectBuilder that will prepend the given message to the failure
message in the event of a test failure. |
static StandardSubjectBuilder |
Truth.assertWithMessage(String format,
Object... args)
Returns a
StandardSubjectBuilder that will prepend the formatted message using the
specified arguments to the failure message in the event of a test failure. |
static StandardSubjectBuilder |
TruthJUnit.assume()
Begins a call chain with the fluent Truth API.
|
protected StandardSubjectBuilder |
Subject.check()
Returns a builder for creating a derived subject but without providing information about how
the derived subject will relate to the current subject.
|
protected StandardSubjectBuilder |
Subject.check(String format,
Object... args)
Returns a builder for creating a derived subject.
|
static StandardSubjectBuilder |
StandardSubjectBuilder.forCustomFailureStrategy(FailureStrategy failureStrategy)
Returns a new instance that invokes the given
FailureStrategy when a check fails. |
protected StandardSubjectBuilder |
Subject.ignoreCheck()
Begins a new call chain that ignores any failures.
|
StandardSubjectBuilder |
ExpectFailure.whenTesting()
Returns a test verb that expects the chained assertion to fail, and makes the failure available
via
ExpectFailure.getFailure() . |
StandardSubjectBuilder |
StandardSubjectBuilder.withMessage(String messageToPrepend) |
StandardSubjectBuilder |
StandardSubjectBuilder.withMessage(String format,
Object... args)
Returns a new instance that will output the given message before the main failure message.
|
Modifier and Type | Method and Description |
---|---|
void |
ExpectFailure.StandardSubjectBuilderCallback.invokeAssertion(StandardSubjectBuilder whenTesting) |
Copyright © 2018. All rights reserved.