use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method validateRequiredFieldsForMinorChild.
@Test
public void validateRequiredFieldsForMinorChild() throws Exception {
RFA1aFormDTO rfa1aForm = prepareValidForm();
ApplicantDTO firstApplicant = rfa1aForm.getFirstApplicant();
MinorChildDTO minorChild = buildEmptyMinorChild(firstApplicant);
minorChild.getRelationshipToApplicants().get(0).setApplicantId(null);
minorChild = minorChildHelper.postMinorChild(rfa1aForm.getId(), minorChild);
List<IssueDetails> cvIssues = getIssueDetails(rfa1aForm);
// "CV000020";
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_MINOR_CHILD_DATE_OF_BIRTH)));
// "CV000021";
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_MINOR_CHILD_GENDER)));
// "CV000022";
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_MINOR_CHILD_FINANCIALLY_SUPPORTED)));
// "CV000023";
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_MINOR_CHILD_ADOPTED)));
// "CV000024";
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_MINOR_CHILD_RELATIONSHIP_APPLICANT_ID)));
}
use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO 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.ApplicantDTO in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method prepareValidForm.
private RFA1aFormDTO prepareValidForm() throws Exception {
RFA1aFormDTO form = formAHelper.createRFA1aForm();
ApplicantDTO applicant = applicantHelper.getValidApplicant();
applicantHelper.postApplicant(form.getId(), applicant);
ResidenceDTO residenceDTO = residenceHelper.getResidenceDTO();
residenceHelper.putResidence(form.getId(), residenceDTO);
return formAHelper.getRFA1aForm(form.getId());
}
use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO 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.ApplicantDTO 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());
}
Aggregations