Package org.assertj.core.api
Class ErrorCollector
java.lang.Object
org.assertj.core.api.ErrorCollector
Collects error messages of all AssertionErrors thrown by the proxied method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AssertionErrorCollector
private static final String
static final String
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addError
(AssertionError error) private static long
static Object
intercept
(ErrorCollector errorCollector, Object assertion, Callable<?> proxy, Method method, Object stub) private static boolean
private void
-
Field Details
-
FIELD_NAME
- See Also:
-
INTERCEPT_METHOD_NAME
- See Also:
-
CLASS_NAME
-
assertionErrorCollector
-
-
Constructor Details
-
ErrorCollector
ErrorCollector(AssertionErrorCollector collector)
-
-
Method Details
-
intercept
@RuntimeType public static Object intercept(@FieldValue("errorCollector") ErrorCollector errorCollector, @This Object assertion, @SuperCall Callable<?> proxy, @SuperMethod(nullIfImpossible=true) Method method, @StubValue Object stub) throws Exception - Parameters:
errorCollector
- theErrorCollector
to gather assertions error for the assertion instanceassertion
- The instance of the method, the this reference.proxy
- A proxy to invoke the original method.method
- A reference to the original method.stub
- A default value for the return type. null for reference type and 0 for the corresponding primitive types.- Returns:
- the assertion result
- Throws:
Exception
- may be thrown from the assertion proxy call
-
addError
-
succeeded
private void succeeded() -
isNestedErrorCollectorProxyCall
private static boolean isNestedErrorCollectorProxyCall() -
countErrorCollectorProxyCalls
private static long countErrorCollectorProxyCalls()
-