use of org.simpleflatmapper.map.property.time.JavaZoneIdProperty in project SimpleFlatMapper by arnaudroger.
the class PreparedStatementFieldMapperFactoryTest method testJavaLocalDate.
@Test
public void testJavaLocalDate() throws Exception {
java.time.LocalDate value = java.time.LocalDate.now();
java.time.ZoneId zoneId = ZoneId.of("America/Los_Angeles");
newFieldMapperAndMapToPS(new ConstantGetter<Object, java.time.LocalDate>(value), java.time.LocalDate.class, new JavaZoneIdProperty(zoneId));
newFieldMapperAndMapToPS(NullGetter.<Object, java.time.LocalDate>getter(), java.time.LocalDate.class);
verify(ps).setDate(1, new java.sql.Date(value.atStartOfDay(zoneId).toInstant().toEpochMilli()));
verify(ps).setNull(2, Types.DATE);
}
use of org.simpleflatmapper.map.property.time.JavaZoneIdProperty in project SimpleFlatMapper by arnaudroger.
the class PropertyTest method testJavaZoneIdProperty.
// IFJAVA8_START
@Test
public void testJavaZoneIdProperty() {
ZoneId zoneId = ZoneId.of("UTC");
JavaZoneIdProperty property = new JavaZoneIdProperty(zoneId);
assertSame(zoneId, property.get());
assertEquals("ZoneId{UTC}", property.toString());
}
Aggregations