use of io.spine.test.validate.msg.MaxNumberFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method provide_one_valid_violation_if_number_is_greater_than_max.
@Test
public void provide_one_valid_violation_if_number_is_greater_than_max() {
final MaxNumberFieldValue msg = MaxNumberFieldValue.newBuilder().setValue(GREATER_THAN_MAX).build();
validate(msg);
assertEquals(1, violations.size());
final ConstraintViolation violation = firstViolation();
assertEquals(GREATER_MAX_MSG, format(violation.getMsgFormat(), violation.getParam(0)));
assertFieldPathIs(violation, VALUE);
assertTrue(violation.getViolationList().isEmpty());
}
use of io.spine.test.validate.msg.MaxNumberFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method find_out_that_number_is_less_than_max_inclusive.
@Test
public void find_out_that_number_is_less_than_max_inclusive() {
final MaxNumberFieldValue msg = MaxNumberFieldValue.newBuilder().setValue(LESS_THAN_MAX).build();
validate(msg);
assertIsValid(true);
}
use of io.spine.test.validate.msg.MaxNumberFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method find_out_that_number_is_equal_to_max_inclusive.
@Test
public void find_out_that_number_is_equal_to_max_inclusive() {
final MaxNumberFieldValue msg = MaxNumberFieldValue.newBuilder().setValue(EQUAL_MAX).build();
validate(msg);
assertIsValid(true);
}
use of io.spine.test.validate.msg.MaxNumberFieldValue in project core-java by SpineEventEngine.
the class MessageValidatorShould method find_out_that_number_is_greater_than_max_inclusive.
/*
* Max option tests.
*/
@Test
public void find_out_that_number_is_greater_than_max_inclusive() {
final MaxNumberFieldValue msg = MaxNumberFieldValue.newBuilder().setValue(GREATER_THAN_MAX).build();
validate(msg);
assertIsValid(false);
}
Aggregations