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 2024/12/26 15:29:39 UTC
(commons-validator) 03/03: Use JUnit Pioneer instead of direct global variables access
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-validator.git
commit 97e7669d717ad5248f5ea622071d6f8af5a19cd2
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 26 10:29:27 2024 -0500
Use JUnit Pioneer instead of direct global variables access
---
.../org/apache/commons/validator/routines/DateValidatorTest.java | 1 -
.../org/apache/commons/validator/routines/PercentValidatorTest.java | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
index d8c0e616..f302262d 100644
--- a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
@@ -29,7 +29,6 @@ import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
-import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.DefaultLocale;
diff --git a/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
index 1bbc7465..88146f6b 100644
--- a/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/PercentValidatorTest.java
@@ -26,6 +26,7 @@ import java.util.Locale;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junitpioneer.jupiter.DefaultLocale;
/**
* Test Case for PercentValidator.
@@ -85,10 +86,8 @@ public class PercentValidatorTest {
* Test Valid percentage values
*/
@Test
+ @DefaultLocale("en-GB")
public void testValid() {
- // Set the default Locale
- Locale.setDefault(Locale.UK);
-
final BigDecimalValidator validator = PercentValidator.getInstance();
final BigDecimal expected = new BigDecimal("0.12");
final BigDecimal negative = new BigDecimal("-0.12");