File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/org/assertj/core/error Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,10 @@ private Optional<AssertionError> tryBuildingMultipleFailuresError(String heading
109
109
if (multipleFailuresError instanceof AssertionError ) { // means that we were able to build a MultipleFailuresError
110
110
List <Throwable > failures = extractFailuresOf (multipleFailuresError );
111
111
// we switch to AssertJMultipleFailuresError in order to control the formatting of the error message.
112
- AssertionError assertionError = new AssertJMultipleFailuresError (heading , failures );
112
+ // we use reflection to avoid making opentest4j a required dependency
113
+ AssertionError assertionError = (AssertionError ) constructorInvoker .newInstance ("org.assertj.core.error.AssertJMultipleFailuresError" ,
114
+ MULTIPLE_FAILURES_ERROR_ARGUMENT_TYPES ,
115
+ array (heading , failures ));
113
116
Failures .instance ().removeAssertJRelatedElementsFromStackTraceIfNeeded (assertionError );
114
117
return Optional .of (assertionError );
115
118
}
You can’t perform that action at this time.
0 commit comments