Search in sources :

Example 6 with Time

use of com.yahoo.elide.datastores.aggregation.timegrains.Time in project elide by yahoo.

the class TimeSerdeTest method testTimeDeserializeYear.

@Test
public void testTimeDeserializeYear() {
    LocalDateTime localDate = LocalDateTime.of(2020, java.time.Month.of(01), 01, 00, 00, 00);
    Time expectedDate = new Time(localDate, true, false, false, false, false, false, (unused) -> "");
    Serde serde = new Time.TimeSerde();
    Object actualDate = serde.deserialize(YEAR);
    assertEquals(expectedDate, actualDate);
    assertEquals(YEAR, serde.serialize(actualDate));
}
Also used : LocalDateTime(java.time.LocalDateTime) Serde(com.yahoo.elide.core.utils.coerce.converters.Serde) Time(com.yahoo.elide.datastores.aggregation.timegrains.Time) LocalDateTime(java.time.LocalDateTime) Test(org.junit.jupiter.api.Test)

Aggregations

Serde (com.yahoo.elide.core.utils.coerce.converters.Serde)6 Time (com.yahoo.elide.datastores.aggregation.timegrains.Time)6 LocalDateTime (java.time.LocalDateTime)6 Test (org.junit.jupiter.api.Test)6