use of io.spine.test.validate.msg.TimeInFutureFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method find_out_that_time_is_in_future.
/*
* Time option tests.
*/
@Test
public void find_out_that_time_is_in_future() {
final TimeInFutureFieldValue validMsg = TimeInFutureFieldValue.newBuilder().setValue(getFuture()).build();
validate(validMsg);
assertIsValid(true);
}
use of io.spine.test.validate.msg.TimeInFutureFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method find_out_that_time_is_NOT_in_future.
@Test
public void find_out_that_time_is_NOT_in_future() {
final TimeInFutureFieldValue invalidMsg = TimeInFutureFieldValue.newBuilder().setValue(getPast()).build();
validate(invalidMsg);
assertIsValid(false);
}
use of io.spine.test.validate.msg.TimeInFutureFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method provide_one_valid_violation_if_time_is_invalid.
@Test
public void provide_one_valid_violation_if_time_is_invalid() {
final TimeInFutureFieldValue invalidMsg = TimeInFutureFieldValue.newBuilder().setValue(getPast()).build();
validate(invalidMsg);
assertEquals(1, violations.size());
final ConstraintViolation violation = firstViolation();
assertEquals("Timestamp value must be in the future.", format(firstViolation().getMsgFormat(), firstViolation().getParam(0)));
assertFieldPathIs(violation, VALUE);
assertTrue(violation.getViolationList().isEmpty());
}
Aggregations