diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java index 21466f41b4..5f01ee56c7 100644 --- a/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java +++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/report/LegacyPojoStackTraceWriter.java @@ -21,8 +21,6 @@ import java.io.PrintWriter; import java.io.StringWriter; -import org.apache.maven.surefire.api.util.internal.StringUtils; - import static org.apache.maven.surefire.shared.utils.StringUtils.isNotEmpty; /** @@ -54,7 +52,7 @@ public String writeTraceToString() { if (isMultiLineExceptionMessage(t)) { // SUREFIRE-986 String exc = t.getClass().getName() + ": "; - if (StringUtils.startsWith(builder, exc)) { + if (builder.indexOf(exc) == 0) { builder.insert(exc.length(), '\n'); } } @@ -105,7 +103,7 @@ public String writeTrimmedTraceToString() { String marker = "at " + testClass + "." + testMethod; - String[] lines = StringUtils.split(text, "\n"); + String[] lines = text.split("\n"); int lastLine = lines.length - 1; int causedByLine = -1; // skip first diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java index 6e7b5e30f0..15d3400e78 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java @@ -18,14 +18,13 @@ */ package org.apache.maven.surefire.its; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @@ -46,14 +45,14 @@ public void testClassesParallel() { } private void checkReports(OutputValidator validator) { - String report = StringUtils.trimToNull(validator + String report = validator .getSurefireReportsFile("junit47ConsoleOutput.Test1-output.txt") - .readFileToString()); - assertNotNull(report); - String report2 = StringUtils.trimToNull(validator + .readFileToString(); + assertTrue(report.isEmpty()); + String report2 = validator .getSurefireReportsFile("junit47ConsoleOutput.Test2-output.txt") - .readFileToString()); - assertNotNull(report2); + .readFileToString(); + assertTrue(report2.isEmpty()); assertFalse(validator .getSurefireReportsFile("junit47ConsoleOutput.Test3-output.txt") .exists());