This is an automated email from the ASF dual-hosted git repository.
dyankiv pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/develop by this push:
new c8d1661 update test to run on java 11
new cfd5a72 Merge pull request #1394 from denysyankiv/DATALAB-2673
c8d1661 is described below
commit c8d16618e346b242b2075153b892ec9b38e0be9d
Author: Denys Yankiv <[email protected]>
AuthorDate: Mon Jan 24 13:12:47 2022 +0200
update test to run on java 11
---
.../com/epam/datalab/util/mongo/IsoLocalDateTimeSerDeTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/services/datalab-utils/src/test/java/com/epam/datalab/util/mongo/IsoLocalDateTimeSerDeTest.java
b/services/datalab-utils/src/test/java/com/epam/datalab/util/mongo/IsoLocalDateTimeSerDeTest.java
index 391238a..108aaf2 100644
---
a/services/datalab-utils/src/test/java/com/epam/datalab/util/mongo/IsoLocalDateTimeSerDeTest.java
+++
b/services/datalab-utils/src/test/java/com/epam/datalab/util/mongo/IsoLocalDateTimeSerDeTest.java
@@ -29,6 +29,7 @@ import org.junit.Test;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
import static org.junit.Assert.assertEquals;
@@ -42,14 +43,14 @@ public class IsoLocalDateTimeSerDeTest {
}
@Test
- public void shoudProperlySerializeLocalDateTimeToJson() throws
JsonProcessingException {
+ public void shouldProperlySerializeLocalDateTimeToJson() throws
JsonProcessingException {
String actual = objectMapper.writeValueAsString(new SampleClass());
assertEquals("{\"localDateTime\":{\"$date\":\"2018-04-10T15:30:45\"}}", actual);
}
@Test
- public void shoudProperlyDeserializeLocalDateTimeFromJson() throws
IOException {
- LocalDateTime now = LocalDateTime.now();
+ public void shouldProperlyDeserializeLocalDateTimeFromJson() throws
IOException {
+ LocalDateTime now = LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS);
long l = now.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
SampleClass actual = objectMapper
.readValue("{\"localDateTime\":{\"$date\":" + l + "}}",
SampleClass.class);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]