From bb60665c22fade4ab99a53c215cce5f86b333d04 Mon Sep 17 00:00:00 2001 From: Vitalii Ananev Date: Sun, 20 Nov 2022 04:17:24 +0300 Subject: [PATCH] increase InstantParser test coverage --- .../table_wrapper/api/InstantParserTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/spacious_team/table_wrapper/api/InstantParserTest.java b/src/test/java/org/spacious_team/table_wrapper/api/InstantParserTest.java index 1ea163a..fe3a838 100644 --- a/src/test/java/org/spacious_team/table_wrapper/api/InstantParserTest.java +++ b/src/test/java/org/spacious_team/table_wrapper/api/InstantParserTest.java @@ -32,6 +32,7 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; +import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.Temporal; @@ -140,16 +141,15 @@ void parseInstantWithSpecifiedDateTimePatternOnlyDate() { } @Test - void parseInstantWithSpecifiedDateTimePatternTime() { - DateTimeFormatter dtf = DateTimeFormatter.ofPattern("+HH-mm.ss"); + void parseInstantWithSpecifiedDateTimePatternTimeAndZone() { + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("+HH-mm.ssx"); InstantParser parser = InstantParser.builder() .dateTimeFormatter(dtf) - .defaultZoneId(UTC) .build(); - String data = "+01-30.45"; + String data = "+01-30.45+01"; Instant expected = LocalTime.of(1, 30, 45) .atDate(LocalDate.now()) - .atZone(UTC) + .atZone(ZoneOffset.ofHours(1)) .toInstant(); assertEquals(expected, parser.parseInstant(data));