Package org.assertj.db.api
Class ErrorCollector
java.lang.Object
org.assertj.db.api.ErrorCollector
Collects error messages of all AssertionErrors thrown by the proxied method.
- Author:
- Julien Roy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Append new error to collection of errors.errors()
Return all errors collected.Apply interception of assertion method to collect exception and avoid stop the assertion flow on the first error.boolean
Return if no error collected in this instance.
-
Constructor Details
-
ErrorCollector
public ErrorCollector()Construct empty error collector.
-
-
Method Details
-
intercept
@RuntimeType public Object intercept(@This Object assertion, @SuperCall Callable<?> proxy, @SuperMethod(nullIfImpossible=true) Method method, @StubValue Object stub) throws Exception Apply interception of assertion method to collect exception and avoid stop the assertion flow on the first error.- Parameters:
assertion
- The assertion object proxiedproxy
- The proxy of assertionmethod
- The method of assertion calledstub
- The sub value if not assert method is found- Returns:
- The current assertion object.
- Throws:
Exception
- When interception fail
-
addError
Append new error to collection of errors.- Parameters:
error
- Any throwable
-
errors
Return all errors collected.- Returns:
- List of exception
-
wasSuccess
public boolean wasSuccess()Return if no error collected in this instance.- Returns:
- true if no errors.
-