@@ -26,12 +26,14 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2626import java .util .ArrayList ;
2727import java .util .Date ;
2828import java .util .List ;
29+ import java .util .Locale ;
2930import java .util .stream .Stream ;
3031
3132import org .junit .jupiter .api .Test ;
3233import org .junit .jupiter .params .ParameterizedTest ;
3334import org .junit .jupiter .params .provider .Arguments ;
3435import org .junit .jupiter .params .provider .MethodSource ;
36+ import org .junitpioneer .jupiter .DefaultLocale ;
3537
3638/**
3739 * Tests for standard Converters.
@@ -72,7 +74,7 @@ void testClass() throws Exception {
7274 assertThrows (ClassNotFoundException .class , () -> Converter .CLASS .apply ("foo.bar" ));
7375 assertNotNull (Converter .CLASS .apply (AClassWithoutADefaultConstructor .class .getName ()));
7476 }
75-
77+
7678 @ Test
7779 void testDate () throws Exception {
7880 assertThrows (java .text .ParseException .class , () -> Converter .DATE .apply ("whatever" ));
@@ -91,6 +93,14 @@ void testDate() throws Exception {
9193 assertThrows (java .text .ParseException .class , () -> Converter .DATE .apply ("Jun 06 17:48:57 EDT 2002" ));
9294 }
9395
96+ @ Test
97+ @ DefaultLocale (language = "de" , country = "DE" )
98+ void testDateLocaleDe () throws Exception {
99+ final Date expected = new Date (1023400137000L );
100+ final String formatted = new SimpleDateFormat ("EEE MMM dd HH:mm:ss zzz yyyy" ).format (expected );
101+ assertEquals (expected , Converter .DATE .apply (formatted ));
102+ }
103+
94104 @ Test
95105 void testFile () throws Exception {
96106 final URL url = this .getClass ().getClassLoader ().getResource ("./org/apache/commons/cli/existing-readable.file" );
0 commit comments