This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
The following commit(s) were added to refs/heads/master by this push:
new 96842a03 Add missing tests for ValidatorUtils.replace and
ValidatorUtils.copyMap (#396).
96842a03 is described below
commit 96842a039634cc4fc29e07e1dca1a8a54935e0ae
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 13 14:57:50 2026 +0000
Add missing tests for ValidatorUtils.replace and ValidatorUtils.copyMap
(#396).
---
src/changes/changes.xml | 1 +
.../java/org/apache/commons/validator/util/ValidatorUtilsTest.java | 4 ----
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 80e8ac1d..ed5a5790 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -78,6 +78,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory,
sahvx655-wq">DoubleValidator and FloatValidator now treat special symbols
consistently (#388).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory, sahvx655-wq">Fix
long range check in GenericTypeValidator.formatLong (#387).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory, sahvx655-wq">Fix
BigIntegerValidator minValue(), maxValue(), and processParsedValue() for out of
Long range values (#397).</action>
+ <action type="fix" dev="ggregory" due-to="Mauricio Bento, Gary
Gregory">Add missing tests for ValidatorUtils.replace and
ValidatorUtils.copyMap (#396)..</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add and use
CheckDigitException.CheckDigitException(String, Object...) (#389).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add and use
ValidatorException.ValidatorException(Throwable). Call sites that previously
called new ValidatorException(Throwable#getMessage()) now preserve that
exception (#390).</action>
diff --git
a/src/test/java/org/apache/commons/validator/util/ValidatorUtilsTest.java
b/src/test/java/org/apache/commons/validator/util/ValidatorUtilsTest.java
index 23624a45..ebef4315 100644
--- a/src/test/java/org/apache/commons/validator/util/ValidatorUtilsTest.java
+++ b/src/test/java/org/apache/commons/validator/util/ValidatorUtilsTest.java
@@ -56,15 +56,12 @@ class ValidatorUtilsTest {
arg.setName("arg");
final Var var = new Var("var", "value", null);
final String plain = "plain";
-
final Map<String, Object> original = new HashMap<>();
original.put("msg", msg);
original.put("arg", arg);
original.put("var", var);
original.put("plain", plain);
-
final Map<String, Object> copy = ValidatorUtils.copyMap(original);
-
assertEquals(original.size(), copy.size());
// Msg, Arg and Var values are deep-copied (cloned into new instances).
assertTrue(copy.get("msg") instanceof Msg);
@@ -88,5 +85,4 @@ class ValidatorUtilsTest {
assertEquals("Hello world", ValidatorUtils.replace("Hello world",
null, "there"));
assertEquals("Hello world", ValidatorUtils.replace("Hello world",
"world", null));
}
-
}