hubertgrzeskowiak commented on code in PR #788: URL: https://github.com/apache/maven-surefire/pull/788#discussion_r1798801882
########## surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java: ########## @@ -317,12 +317,14 @@ private String[] toClassMethodName(TestIdentifier testIdentifier) { boolean needsSpaceSeparator = isNotBlank(parentDisplay) && !display.startsWith("["); String methodDisplay = parentDisplay + (needsSpaceSeparator ? " " : "") + display; + boolean isParameterized = isNotBlank(methodSource.getMethodParameterTypes()); boolean hasParameterizedParent = collectAllTestIdentifiersInHierarchy(testIdentifier) .filter(identifier -> !identifier.getSource().isPresent()) .map(TestIdentifier::getLegacyReportingName) .anyMatch(legacyReportingName -> legacyReportingName.matches("^\\[.+]$")); + boolean isTestTemplate = testIdentifier.getLegacyReportingName().matches("^.*\\[\\d+]$"); Review Comment: Thanks for the good question! A test template function gets invoked within a loop (stream to be precise), once for each invocation context. This legacy name contains the index of the invocation and is unrelated to any params the method actually receives, and even unrelated to the display name we set in the invocation context. I just also double checked by changing the integers used in the test fixtures to strings, and the tests pass just fine. -- 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. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org