[ 
https://issues.apache.org/jira/browse/SUREFIRE-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873980#comment-17873980
 ] 

ASF GitHub Bot commented on SUREFIRE-2172:
------------------------------------------

elharo commented on code in PR #768:
URL: https://github.com/apache/maven-surefire/pull/768#discussion_r1718500008


##########
surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java:
##########
@@ -46,11 +45,11 @@ public void testClassesParallel() {
     }
 
     private void checkReports(OutputValidator validator) {
-        String report = StringUtils.trimToNull(validator
+        String report = trimToNull(validator
                 
.getSurefireReportsFile("junit47ConsoleOutput.Test1-output.txt")
                 .readFileToString());
         assertNotNull(report);
-        String report2 = StringUtils.trimToNull(validator
+        String report2 = trimToNull(validator

Review Comment:
   This is test code. The output and input should be fully reproducible as 
either null or not null, so we likely don't need any of this empty to null 
conversion here. Depending on what the output is either simply remove 
trimToNull, or remove trimToNull and expect an empty string instead of null. 
Much simpler. 





> StringUtils: yet more of them
> -----------------------------
>
>                 Key: SUREFIRE-2172
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2172
>             Project: Maven Surefire
>          Issue Type: Improvement
>            Reporter: Elliotte Rusty Harold
>            Priority: Minor
>              Labels: up-for-grabs
>
> This project contains not one, not two, but **three** different StringUtils 
> classes that duplicate functionality in the JDK and elsewhere. One or two of 
> them imght be built by shading other classes. They're even sometimes both 
> imported in the same classes such as LegacyPojoStackTraceWriter:
> import org.apache.maven.surefire.api.util.internal.StringUtils;
> import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty;
> Figure out what to do about this. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to