use of com.yahoo.elide.datastores.aggregation.timegrains.Second in project elide by yahoo.
the class SecondSerdeTest method testDeserializeTimestamp.
@Test
public void testDeserializeTimestamp() {
String dateInString = "2020-01-01T01:18:19";
Second expectedDate = new Second(LocalDateTime.from(formatter.parse(dateInString)));
Timestamp timestamp = new Timestamp(expectedDate.getTime());
Serde serde = new Second.SecondSerde();
Object actualDate = serde.deserialize(timestamp);
assertEquals(expectedDate, actualDate);
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Second in project elide by yahoo.
the class SecondSerdeTest method testDateSerialize.
@Test
public void testDateSerialize() {
String expected = "2020-01-01T01:18:19";
Second expectedDate = new Second(LocalDateTime.from(formatter.parse(expected)));
Serde serde = new Second.SecondSerde();
Object actual = serde.serialize(expectedDate);
assertEquals(expected, actual);
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Second in project elide by yahoo.
the class SecondSerdeTest method testDateDeserializeString.
@Test
public void testDateDeserializeString() {
String dateInString = "2020-01-01T01:18:19";
Second expectedDate = new Second(LocalDateTime.from(formatter.parse(dateInString)));
String actual = "2020-01-01T01:18:19";
Serde serde = new Second.SecondSerde();
Object actualDate = serde.deserialize(actual);
assertEquals(expectedDate, actualDate);
}
use of com.yahoo.elide.datastores.aggregation.timegrains.Second in project elide by yahoo.
the class SecondSerdeTest method testDeserializeOffsetDateTime.
@Test
public void testDeserializeOffsetDateTime() {
String dateInString = "2020-01-01T01:18:19";
Second expectedDate = new Second(LocalDateTime.from(formatter.parse(dateInString)));
OffsetDateTime dateTime = OffsetDateTime.of(2020, 1, 1, 1, 18, 19, 0, ZoneOffset.UTC);
Serde serde = new Second.SecondSerde();
Object actualDate = serde.deserialize(dateTime);
assertEquals(expectedDate, actualDate);
}
Aggregations