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
The following commit(s) were added to refs/heads/master by this push:
new 195f71b1 Use JUnit Pioneer instead of direct global variables access
195f71b1 is described below
commit 195f71b127528b71a33d3357528c501503b5c4bc
Author: Gary D. Gregory <[email protected]>
AuthorDate: Thu Dec 26 10:08:39 2024 -0500
Use JUnit Pioneer instead of direct global variables access
---
.../apache/commons/validator/routines/DateValidatorTest.java | 10 ++--------
1 file changed, 2 insertions(+), 8 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 c3f57765..d8c0e616 100644
--- a/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DateValidatorTest.java
@@ -32,6 +32,7 @@ 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;
/**
* Test Case for DateValidator.
@@ -39,23 +40,16 @@ import org.junit.jupiter.api.Test;
public class DateValidatorTest extends AbstractCalendarValidatorTest {
private DateValidator dateValidator;
- private Locale originalLocale;
/**
* Sets up test fixtures.
*/
@BeforeEach
protected void setUp() {
- originalLocale = Locale.getDefault();
dateValidator = new DateValidator();
validator = dateValidator;
}
- @AfterEach
- protected void tearDown() {
- Locale.setDefault(originalLocale);
- }
-
/**
* Test compare date methods
*/
@@ -134,8 +128,8 @@ public class DateValidatorTest extends
AbstractCalendarValidatorTest {
* Test DateValidator validate Methods
*/
@Test
+ @DefaultLocale(country = "US", language = "en")
public void testDateValidatorMethods() {
- Locale.setDefault(Locale.US);
final Locale locale = Locale.GERMAN;
final String pattern = "yyyy-MM-dd";
final String patternVal = "2005-12-31";