use of gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method validateRequiredFieldsForMinorChildFulfilled.
@Test
public void validateRequiredFieldsForMinorChildFulfilled() throws Exception {
RFA1aFormDTO rfa1aForm = prepareValidForm();
ApplicantDTO firstApplicant = rfa1aForm.getFirstApplicant();
MinorChildDTO minorChild = minorChildHelper.buildNewMinorChildDTO(firstApplicant);
minorChild = minorChildHelper.postMinorChild(rfa1aForm.getId(), minorChild);
Response response = statusHelper.submitApplication(rfa1aForm.getId());
assertNotEquals(422, response.getStatus());
}
use of gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method buildEmptyMinorChild.
private MinorChildDTO buildEmptyMinorChild(ApplicantDTO firstApplicant) throws IOException {
MinorChildDTO minorChild = minorChildHelper.buildNewMinorChildDTO(firstApplicant);
minorChild.setDateOfBirth(null);
minorChild.setGender(null);
minorChild.setChildFinanciallySupported(null);
minorChild.setChildAdopted(null);
return minorChild;
}
use of gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method validateRequiredFieldsForMinorChildWhenRelationshipsIsNull.
@Test
public void validateRequiredFieldsForMinorChildWhenRelationshipsIsNull() throws Exception {
RFA1aFormDTO rfa1aForm = prepareValidForm();
ApplicantDTO firstApplicant = rfa1aForm.getFirstApplicant();
MinorChildDTO minorChild = buildEmptyMinorChild(firstApplicant);
minorChild.setRelationshipToApplicants(null);
minorChildHelper.postMinorChild(rfa1aForm.getId(), minorChild);
Response response = statusHelper.submitApplication(rfa1aForm.getId());
assertNotEquals(422, response.getStatus());
}
use of gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method validateRequiredFieldsForMinorChildWhenRelationshipsIsEmpty.
@Test
public void validateRequiredFieldsForMinorChildWhenRelationshipsIsEmpty() throws Exception {
RFA1aFormDTO rfa1aForm = prepareValidForm();
ApplicantDTO firstApplicant = rfa1aForm.getFirstApplicant();
MinorChildDTO minorChild = buildEmptyMinorChild(firstApplicant);
minorChild.setRelationshipToApplicants(Collections.emptyList());
minorChildHelper.postMinorChild(rfa1aForm.getId(), minorChild);
Response response = statusHelper.submitApplication(rfa1aForm.getId());
assertNotEquals(422, response.getStatus());
}
use of gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO in project cals-api by ca-cwds.
the class MinorChildHelper method createMinorChildren.
public List<MinorChildDTO> createMinorChildren(Long formId, ApplicantDTO reletiveApplicant) throws Exception {
List<MinorChildDTO> minorChildDTOs = new ArrayList<>(2);
for (int i = 0; i < 2; i++) {
MinorChildDTO minorChildDTO = buildNewMinorChildDTO(reletiveApplicant);
minorChildDTO.setOtherRelativeFirstName(minorChildDTO.getOtherRelativeFirstName() + i);
minorChildDTO.setOtherRelativeLastName(minorChildDTO.getOtherRelativeLastName() + i);
minorChildDTOs.add(postMinorChild(formId, minorChildDTO));
}
return minorChildDTOs;
}
Aggregations