You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/07/18 13:55:12 UTC
[commons-text] branch master updated: Simplify test.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push:
new d96a3cb Simplify test.
d96a3cb is described below
commit d96a3cb76f5f25b9f71bc4bdfa9fbc135812c4d2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 18 09:55:06 2020 -0400
Simplify test.
---
.../commons/text/io/StringSubstitutorFilterReaderTest.java | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/test/java/org/apache/commons/text/io/StringSubstitutorFilterReaderTest.java b/src/test/java/org/apache/commons/text/io/StringSubstitutorFilterReaderTest.java
index 3d25606..18c82f9 100644
--- a/src/test/java/org/apache/commons/text/io/StringSubstitutorFilterReaderTest.java
+++ b/src/test/java/org/apache/commons/text/io/StringSubstitutorFilterReaderTest.java
@@ -27,6 +27,7 @@ import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Arrays;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.io.IOUtils;
@@ -90,11 +91,7 @@ public class StringSubstitutorFilterReaderTest extends StringSubstitutorTest {
Arrays.fill(expectedCh, (char) 0);
}
}
- if (replaceTemplate == null) {
- assertEquals(StringUtils.EMPTY, actualResultWriter.toString());
- } else {
- assertEquals(expectedResult, actualResultWriter.toString());
- }
+ assertEquals(Objects.toString(expectedResult, StringUtils.EMPTY), actualResultWriter.toString());
}
private void doTestReplaceInCharSteps(final StringSubstitutor substitutor, final String expectedResult,
@@ -117,11 +114,7 @@ public class StringSubstitutorFilterReaderTest extends StringSubstitutorTest {
assertFalse(index.get() > expectedResultLen, () -> "Index: " + index.get());
}
}
- if (replaceTemplate == null) {
- assertEquals(StringUtils.EMPTY, actualResultWriter.toString());
- } else {
- assertEquals(expectedResult, actualResultWriter.toString());
- }
+ assertEquals(Objects.toString(expectedResult, StringUtils.EMPTY), actualResultWriter.toString());
}
@Override