Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
hurutoriya committed Dec 20, 2023
1 parent f450005 commit 137e887
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Locale;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.notNullValue;
Expand Down Expand Up @@ -186,11 +188,9 @@ public void testChangeFormat() throws IOException {
}

public void testChangeLocale() throws IOException {
DocumentMapper mapper = createDocumentMapper(
fieldMapping(b -> b.field("type", "date").field("format", "E, d MMM yyyy HH:mm:ss Z").field("locale", "de"))
);

mapper.parse(source(b -> b.field("field", "Mi, 06 Dez 2000 02:55:00 -0800")));
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("E, dd MMM yyyy HH:mm:ss Z", Locale.forLanguageTag("de"));
String dateString = "Mi, 06 Dez 2000 02:55:00 -0800";
ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateString, formatter);
}

public void testNullValue() throws IOException {
Expand Down

0 comments on commit 137e887

Please sign in to comment.