public final class TestResult extends Object
| Constructor and Description |
|---|
TestResult()
Creates a new result for a successful test.
|
TestResult(Throwable causeForFailure)
Creates a new result for a successful test if the exception is
null, or a failed test otherwise. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
static TestResult |
failure(Throwable causeForFailure)
Descriptive convenience method for constructing a result for a failed test input.
|
Optional<Throwable> |
getCauseForFailure() |
int |
hashCode() |
boolean |
isSuccessful() |
boolean |
isUnsuccessful() |
static TestResult |
success()
Descriptive convenience method for constructing a result for a successful test input.
|
String |
toString() |
public TestResult()
public TestResult(Throwable causeForFailure)
null, or a failed test otherwise.causeForFailure - the exception which caused the failurepublic static TestResult success()
public static TestResult failure(Throwable causeForFailure)
causeForFailure - the exception which caused the test to fail, or indicates that it has failedpublic boolean isSuccessful()
public boolean isUnsuccessful()
public Optional<Throwable> getCauseForFailure()
Copyright © 2019. All rights reserved.