Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
Expand Down Expand Up @@ -345,7 +346,8 @@ void testSQLTime() {
java.sql.Time time = new java.sql.Time(1766419274);
JsonNode result = JsonNormalizer.normalize(time);
assertTrue(result.isString());
assertEquals("11:40:19", result.asString());
String expected = time.toLocalTime().format(DateTimeFormatter.ISO_LOCAL_TIME);
assertEquals(expected, result.asString());
}

@Test
Expand All @@ -354,7 +356,8 @@ void testSQLTimeStamp() {
java.sql.Timestamp dateTime = new java.sql.Timestamp(1766419274);
JsonNode result = JsonNormalizer.normalize(dateTime);
assertTrue(result.isString());
assertEquals("1970-01-21T11:40:19.274", result.asString());
String expected = dateTime.toLocalDateTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
assertEquals(expected, result.asString());
}


Expand Down Expand Up @@ -1191,7 +1194,8 @@ void givenCalendar_whenTryNormalizeTemporal_thenIsoStringNode() throws Exception

// Then
assertInstanceOf(StringNode.class, result);
assertEquals("2017-02-16T19:22:28Z", ((JsonNode) result).asString());
String expected = input.toInstant().toString();
assertEquals(expected, ((JsonNode) result).asString());
}

@Test
Expand All @@ -1205,7 +1209,8 @@ void givenGregorianCalendar_whenTryNormalizeTemporal_thenIsoStringNode() throws

// Then
assertInstanceOf(StringNode.class, result);
assertEquals("2017-02-16T19:22:28Z", ((JsonNode) result).asString());
String expected = input.toInstant().toString();
assertEquals(expected, ((JsonNode) result).asString());
}

@Test
Expand Down
Loading