use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneTypeValidationTest.
@Test
public void phoneTypeValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertTrue(violations.isEmpty());
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneNumberLessThan10digitsValidationTest.
@Test
public void phoneNumberLessThan10digitsValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setNumber("123456789");
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertEquals(violations.size(), 1);
String actualMessage = violations.iterator().next().getMessage();
String expectedMessage = getBetweenLengthMessage(10, 10);
assertEquals(expectedMessage, actualMessage);
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOHelper method createPhoneNumberType.
public static PhoneNumberType createPhoneNumberType(Long id, String value) {
PhoneNumberType phoneType = new PhoneNumberType();
phoneType.setId(id);
phoneType.setValue(value);
return phoneType;
}
Aggregations