| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final List | |
| private AssertionErrorCollector | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAfterAssertionErrorCollected(AfterAssertionErrorCollected
the callback. afterAssertionErrorCollected)Register a callback allowing to react after an |
| public List | Returns: A list of soft assertions collected errors.Implements org. |
| public void | collectAssertionError(AssertionError
the error)AssertionError to collect.Implements org. |
| protected < the supertype to use in the list return value T extends Throwable> List | Returns: decorated listlist of errors to decorate errors)Modifies collected errors. |
| public Optional | |
| public void | setAfterAssertionErrorCollected(AfterAssertionErrorCollected
the callback. afterAssertionErrorCollected)Same as |
| public void | setDelegate(AssertionErrorCollector
the delegate)AssertionErrorCollector to which the assertions will be forwarded.Overrides default org. |
| public void | succeeded()
Implements org. |
| public boolean | wasSuccess()
Implements org. |
| callbacks | back to summary |
|---|---|
| private final List<AfterAssertionErrorCollected> callbacks | |
| collectedAssertionErrors | back to summary |
|---|---|
| private final List<AssertionError> collectedAssertionErrors | |
| delegate | back to summary |
|---|---|
| private AssertionErrorCollector delegate | |
| wasSuccess | back to summary |
|---|---|
| private volatile boolean wasSuccess | |
| DefaultAssertionErrorCollector | back to summary |
|---|---|
| public DefaultAssertionErrorCollector() | |
| addAfterAssertionErrorCollected | back to summary |
|---|---|
| public void addAfterAssertionErrorCollected(AfterAssertionErrorCollected afterAssertionErrorCollected) Register a callback allowing to react after an
The callback is an instance of Example:
Resulting
Alternatively, if you have defined your own SoftAssertions subclass and inherited from
| |
| assertionErrorsCollected | back to summary |
|---|---|
| public List Implements org. Returns a list of soft assertions collected errors. If a delegate
has been set (see
| |
| collectAssertionError | back to summary |
|---|---|
| public void collectAssertionError(AssertionError error) Implements org. Doc from org. This method can be used to collect soft assertion errors.
To be able to react after an assertion error is collected, use
| |
| decorateErrorsCollected | back to summary |
|---|---|
| protected <T extends Throwable> List Modifies collected errors. Override to customize modification. | |
| getDelegate | back to summary |
|---|---|
| public Optional Overrides default org.
| |
| setAfterAssertionErrorCollected | back to summary |
|---|---|
| public void setAfterAssertionErrorCollected(AfterAssertionErrorCollected afterAssertionErrorCollected) Same as
| |
| setDelegate | back to summary |
|---|---|
| public void setDelegate(AssertionErrorCollector delegate) Overrides default org. Doc from org. Optionally sets a "delegate" collector into which the collected assertions will be deposited. Note that if you set a delegate, this instance will no longer collect or report assertion errors itself but will forward them all to the delegate for collection.
| |
| succeeded | back to summary |
|---|---|
| public void succeeded() Implements org. Doc from org. Indicates/sets that the last assertion was a success.
| |
| wasSuccess | back to summary |
|---|---|
| public boolean wasSuccess() Implements org. Doc from org. Returns the result of last soft assertion which can be used to decide what the next one should be. Example:
| |