Tibor17 commented on a change in pull request #267: [SUREFIRE-1741] JUnit5:
Detect failed containers
URL: https://github.com/apache/maven-surefire/pull/267#discussion_r370868639
##########
File path:
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java
##########
@@ -173,8 +175,9 @@ private SimpleReportEntry createReportEntry(
TestIdentifier testIdentifier,
{
classText = null;
}
- String methodName = testIdentifier.isTest() ? classMethodName[2] :
null;
- String methodText = testIdentifier.isTest() ? classMethodName[3] :
null;
+ boolean isFailedContainer = isFailedContainer( testIdentifier,
testExecutionResult );
+ String methodName = ( isFailedContainer || testIdentifier.isTest() ) ?
classMethodName[2] : null;
Review comment:
You do not have to use brackets in `( isFailedContainer ||
testIdentifier.isTest() )`. There is no collision between boolean and String in
this case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services