| Modifier and Type | Method and Description |
|---|---|
| public List | |
| public void | collectAssertionError(AssertionError
the error)AssertionError to collect.This method can be used to collect soft assertion errors. |
| public default Optional | |
| public default void | onAssertionErrorCollected(AssertionError
the collected assertionError)AssertionError.Implements org. AssertionError is collected by soft assertions
(you can't prevent the error to be collected).
|
| public default void | setDelegate(AssertionErrorCollector
the delegate)AssertionErrorCollector to which the assertions will be forwarded.Optionally sets a "delegate" collector into which the collected assertions will be deposited. |
| public void | |
| public boolean | Returns: true if the last assertion was a success.Returns the result of last soft assertion which can be used to decide what the next one should be. |
| assertionErrorsCollected | back to summary |
|---|---|
| public List | |
| collectAssertionError | back to summary |
|---|---|
| public void collectAssertionError(AssertionError error) This method can be used to collect soft assertion errors.
To be able to react after an assertion error is collected, use
| |
| getDelegate | back to summary |
|---|---|
| public default Optional | |
| onAssertionErrorCollected | back to summary |
|---|---|
| public default void onAssertionErrorCollected(AssertionError assertionError) Implements org. Doc from org. This method is called after each
If you just use the standard soft assertions classes provided by AssertJ, you can register your callback with
Example with custom soft assertions:
Example with standard soft assertions:
| |
| setDelegate | back to summary |
|---|---|
| public default void setDelegate(AssertionErrorCollector delegate) 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() Indicates/sets that the last assertion was a success. | |
| wasSuccess | back to summary |
|---|---|
| public boolean wasSuccess() Returns the result of last soft assertion which can be used to decide what the next one should be. Example:
| |