Search in sources :

Example 1 with TestingConnectorSession

use of io.trino.testing.TestingConnectorSession in project trino by trinodb.

the class TestDateTimeFunctions method assertCurrentDateAtInstant.

private void assertCurrentDateAtInstant(TimeZoneKey timeZoneKey, Instant instant) {
    long expectedDays = epochDaysInZone(timeZoneKey, instant);
    TestingConnectorSession connectorSession = TestingConnectorSession.builder().setStart(instant).setTimeZoneKey(timeZoneKey).build();
    long dateTimeCalculation = currentDate(connectorSession);
    assertEquals(dateTimeCalculation, expectedDays);
}
Also used : TestingConnectorSession(io.trino.testing.TestingConnectorSession)

Aggregations

TestingConnectorSession (io.trino.testing.TestingConnectorSession)1