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 a22e4da More tests.
a22e4da is described below
commit a22e4da254e30bfcfac06d2c77b74c37ff072819
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jun 29 12:25:13 2020 -0400
More tests.
---
.../java/org/apache/commons/text/StringSubstitutorTest.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index 8a28c7c..409193d 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -162,8 +162,8 @@ public class StringSubstitutorTest {
*
* @throws IOException Thrown by subclasses.
*/
- protected String replace(final StringSubstitutor stringSubstitutor, final
String source) throws IOException {
- return stringSubstitutor.replace(source);
+ protected String replace(final StringSubstitutor stringSubstitutor, final
String template) throws IOException {
+ return stringSubstitutor.replace(template);
}
@BeforeEach
@@ -229,9 +229,12 @@ public class StringSubstitutorTest {
@Test
public void testReplaceChangedMap() throws IOException {
final StringSubstitutor sub = new StringSubstitutor(values);
+ // no map change
+ final String template = "The ${animal} jumps over the ${target}.";
+ assertEquals("The quick brown fox jumps over the lazy dog.",
replace(sub, template));
+ // map change
values.put("target", "moon");
- assertEquals("The quick brown fox jumps over the moon.",
- replace(sub, "The ${animal} jumps over the ${target}."));
+ assertEquals("The quick brown fox jumps over the moon.", replace(sub,
template));
}
/**