use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method do_not_accept_equal_OffsetDateTime_values.
@Test(expected = IllegalArgumentException.class)
public void do_not_accept_equal_OffsetDateTime_values() {
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetDateTime now = OffsetDateTimes.now(inLuxembourg);
Changes.of(now, now);
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method do_not_accept_null_OffsetDateTime_newValue.
@Test(expected = NullPointerException.class)
public void do_not_accept_null_OffsetDateTime_newValue() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final OffsetDateTime now = OffsetDateTimes.now(inKiev);
Changes.of(now, null);
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method create_OffsetTimeChange_instance.
@Test
public void create_OffsetTimeChange_instance() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetTime previousTime = OffsetTimes.now(inKiev);
final OffsetTime newTime = OffsetTimes.now(inLuxembourg);
final OffsetTimeChange result = Changes.of(previousTime, newTime);
assertEquals(previousTime, result.getPreviousValue());
assertEquals(newTime, result.getNewValue());
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ZoneOffsetStringifier method fromString.
@Override
protected ZoneOffset fromString(String str) {
checkNotNull(str);
final ZoneOffset result;
try {
result = ZoneOffsets.parse(str);
} catch (ParseException e) {
throw illegalArgumentWithCauseOf(e);
}
return result;
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ZoneOffsetStringifierShould method convert_negative_zone_offset.
@Test
public void convert_negative_zone_offset() {
final Stringifier<ZoneOffset> stringifier = getStringifier();
final ZoneOffset negative = ZoneOffsets.ofHoursMinutes(-3, -45);
assertEquals(negative, stringifier.reverse().convert(stringifier.convert(negative)));
}
Aggregations