use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneNumberNullValidationTest.
@Test
public void phoneNumberNullValidationTest() {
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 phoneNumberValidationTestBlank.
@Test
public void phoneNumberValidationTestBlank() {
PhoneDTO phone = new PhoneDTO();
phone.setNumber(" ");
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 phoneNumberNonDigitsValidationTest.
@Test
public void phoneNumberNonDigitsValidationTest() {
String number = "123456789a";
PhoneDTO phone = new PhoneDTO();
phone.setNumber(number);
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertEquals(violations.size(), 1);
String actualMessage = violations.iterator().next().getMessage();
String expectedMessage = getNumericMessage(number);
assertEquals(expectedMessage, actualMessage);
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneNumberMoreThan10digitsValidationTest.
@Test
public void phoneNumberMoreThan10digitsValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setNumber("12345678901");
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 PhoneDTOTest method phoneNumberValidationTest.
@Test
public void phoneNumberValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setNumber("1234567890");
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertTrue(violations.isEmpty());
}
Aggregations