Skip to content

Commit 6305025

Browse files
committed
Fix a test
Locale.ROOT doesn't round trip -- it results in a langugage tag of "und" (undefined, I suppose), and when you round-trip back you don't get Locale.ROOT from it. The old test worked because it was fundamentally just testing that the template script execution would result in the expected string (whether or not you could actually do anything with the Locale that would result), while this new test is checking the round-trip behavior.
1 parent d191b0c commit 6305025

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateProcessorFactoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testParseLocale() throws Exception {
8484
String sourceField = randomAlphaOfLengthBetween(1, 10);
8585
config.put("field", sourceField);
8686
config.put("formats", List.of("dd/MM/yyyyy"));
87-
Locale locale = randomFrom(Locale.GERMANY, Locale.FRENCH, Locale.ROOT);
87+
Locale locale = randomFrom(Locale.GERMANY, Locale.FRENCH, Locale.CANADA);
8888
config.put("locale", locale.toLanguageTag());
8989

9090
DateProcessor processor = factory.create(null, null, null, config, null);

0 commit comments

Comments
 (0)