// The database does not store a time zone, so we assume the date is in the system's time zone. But to make these tests
// compare epoch times but still work with any system time zone, we have to offset the epoch to the system's time zone.
@Test
    public void fetchExistingAggregateById_populatesValues()
    {
        try(PhotonTransaction transaction = photon.beginTransaction())
        {
            PhotonTestTable photonTestTable = transaction.query(PhotonTestTable.class).fetchById(1);
            // The database does not store a time zone, so we assume the date is in the system's time zone. But to make these tests
            // compare epoch times but still work with any system time zone, we have to offset the epoch to the system's time zone.
            int currentUtcOffset = TimeZone.getDefault().getOffset(new Date().getTime());
            assertNotNull(photonTestTable);
            assertEquals(1, photonTestTable.getId());
            assertEquals(UUID.fromString("8ED1E1BD-253E-4469-B4CB-71E1217825B7"), photonTestTable.getUuidColumn());
            assertEquals(ZonedDateTime.ofInstant(Instant.ofEpochMilli(1489915698000L - currentUtcOffset), ZoneId.systemDefault()), photonTestTable.getDateColumn());
            assertEquals("Test String", photonTestTable.getVarcharColumn());
        }
    }
{
PhotonTestTable photonTestTable = transaction.query(PhotonTestTable.class).fetchById(1);
// The database does not store a time zone, so we assume the date is in the system's time zone. But to make these tests
// compare epoch times but still work with any system time zone, we have to offset the epoch to the system's time zone.
int currentUtcOffset = TimeZone.getDefault().getOffset(new Date().getTime());
assertNotNull(photonTestTable);
@Test
public void fetchExistingAggregateById_populatesValues()
{
try(PhotonTransaction transaction = photon.beginTransaction())
{
PhotonTestTable photonTestTable = transaction.query(PhotonTestTable.class).fetchById(1);
// The database does not store a time zone, so we assume the date is in the system's time zone. But to make these tests
// compare epoch times but still work with any system time zone, we have to offset the epoch to the system's time zone.
int currentUtcOffset = TimeZone.getDefault().getOffset(new Date().getTime());
assertNotNull(photonTestTable);
assertEquals(1, photonTestTable.getId());
assertEquals(UUID.fromString("8ED1E1BD-253E-4469-B4CB-71E1217825B7"), photonTestTable.getUuidColumn());
assertEquals(ZonedDateTime.ofInstant(Instant.ofEpochMilli(1489915698000L - currentUtcOffset), ZoneId.systemDefault()), photonTestTable.getDateColumn());
assertEquals("Test String", photonTestTable.getVarcharColumn());
}
}
@Test
public void fetchExistingAggregateById_populatesValues()
{
try(PhotonTransaction transaction = photon.beginTransaction())
{
PhotonTestTable photonTestTable = transaction.query(PhotonTestTable.class).fetchById(1);
// The database does not store a time zone, so we assume the date is in the system's time zone. But to make these tests
// compare epoch times but still work with any system time zone, we have to offset the epoch to the system's time zone.
int currentUtcOffset = TimeZone.getDefault().getOffset(new Date().getTime());
assertNotNull(photonTestTable);
assertEquals(1, photonTestTable.getId());
assertEquals(UUID.fromString("8ED1E1BD-253E-4469-B4CB-71E1217825B7"), photonTestTable.getUuidColumn());
assertEquals(ZonedDateTime.ofInstant(Instant.ofEpochMilli(1489915698000L - currentUtcOffset), ZoneId.systemDefault()), photonTestTable.getDateColumn());
assertEquals("Test String", photonTestTable.getVarcharColumn());
}
}