use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneExtensionNullValidationTest.
@Test
public void phoneExtensionNullValidationTest() {
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 RFA1aRequiredFieldsValidationTest method prepareEmptyForm.
private RFA1aFormDTO prepareEmptyForm() throws Exception {
RFA1aFormDTO form = formAHelper.createRFA1aForm();
ApplicantDTO applicant = applicantHelper.getValidApplicant();
applicant.setOtherNames(Collections.singletonList(new TypedPersonNameDTO()));
applicant.setDateOfBirth(null);
applicant.setDriverLicenseNumber("11111111");
applicant.setDriverLicenseState(null);
PhoneDTO phoneDTO = new PhoneDTO();
PhoneNumberType phoneNumberType = new PhoneNumberType();
phoneNumberType.setId(1L);
phoneNumberType.setValue("Cell");
phoneDTO.setPhoneType(phoneNumberType);
PhoneDTO secondaryPhoneDTO = new PhoneDTO();
secondaryPhoneDTO.setPhoneType(phoneNumberType);
applicant.setPhones(Arrays.asList(phoneDTO, secondaryPhoneDTO));
applicantHelper.postApplicant(form.getId(), applicant);
ResidenceDTO residenceDTO = residenceHelper.getResidenceDTO();
residenceDTO.setResidenceOwnership(null);
residenceDTO.setBodyOfWaterExist(null);
residenceDTO.setOthersUsingResidenceAsMailing(null);
residenceDTO.setPhysicalMailingSimilar(null);
residenceDTO.setWeaponInHome(null);
residenceDTO.setHomeLanguages(null);
// Create residential address
RFAAddressDTO residentialAddress = new RFAAddressDTO();
AddressType addressType = new AddressType();
addressType.setId(1L);
addressType.setValue("Residential");
residentialAddress.setType(addressType);
residenceDTO.setAddresses(Arrays.asList(// Resiadential address
residentialAddress, // Empty Address object
new RFAAddressDTO()));
residenceHelper.putResidence(form.getId(), residenceDTO);
return form;
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType in project cals-api by ca-cwds.
the class PhoneDTOTest method phoneExtensionValidationTest.
@Test
public void phoneExtensionValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setExtension("1234567");
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 phoneExtensionMoreThen7ValidationTest.
@Test
public void phoneExtensionMoreThen7ValidationTest() {
PhoneDTO phone = new PhoneDTO();
phone.setExtension("12345678");
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertEquals(violations.size(), 1);
String actualMessage = violations.iterator().next().getMessage();
String expectedMessage = getBetweenLengthMessage(0, 7);
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 phoneExtensionHasNonDigitCharsValidationTest.
@Test
public void phoneExtensionHasNonDigitCharsValidationTest() {
PhoneDTO phone = new PhoneDTO();
String extension = "a";
phone.setExtension(extension);
phone.setPhoneType(new PhoneNumberType());
Set<ConstraintViolation<PhoneDTO>> violations = removeDbSessionViolation(validate(phone));
assertEquals(violations.size(), 1);
String actualMessage = violations.iterator().next().getMessage();
String expectedMessage = getNumericMessage(extension);
assertEquals(expectedMessage, actualMessage);
}
Aggregations