Search in sources :

Example 11 with PhoneNumberType

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());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) PhoneNumberType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType) Test(org.junit.Test)

Example 12 with PhoneNumberType

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);
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) PhoneNumberType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType) Test(org.junit.Test)

Example 13 with PhoneNumberType

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;
}
Also used : PhoneNumberType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType)

Aggregations

PhoneNumberType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType)13 ConstraintViolation (javax.validation.ConstraintViolation)11 Test (org.junit.Test)11 AddressType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.AddressType)1 ApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)1 PhoneDTO (gov.ca.cwds.cals.service.dto.rfa.PhoneDTO)1 RFA1aFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO)1 RFAAddressDTO (gov.ca.cwds.cals.service.dto.rfa.RFAAddressDTO)1 ResidenceDTO (gov.ca.cwds.cals.service.dto.rfa.ResidenceDTO)1 TypedPersonNameDTO (gov.ca.cwds.cals.service.dto.rfa.TypedPersonNameDTO)1