use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.
the class StateReferentialIntegrityForEachValidator method getPersistentObject.
@Override
protected <T extends PersistentObject> PersistentObject getPersistentObject(Session currentSession, T obj, Serializable primaryKey) {
PersistentObject found;
Query<StateType> query = currentSession.createNamedQuery(NAMED_QUERY_FIND_STATE_BY_CODE, StateType.class);
query.setParameter("stateCode", primaryKey);
found = query.uniqueResult();
return found;
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.
the class RFA1aRequiredFieldsValidationTest method checkDriverLicenseNumberFormTest.
@Test
public void checkDriverLicenseNumberFormTest() throws Exception {
RFA1aFormDTO form = prepareValidForm();
ApplicantDTO applicant = applicantHelper.getValidApplicant();
applicant.setFirstName("Some");
applicant.setDriverLicenseNumber("");
StateType driverLicenseState = new StateType();
driverLicenseState.setId("CA");
driverLicenseState.setValue("California");
applicant.setDriverLicenseState(driverLicenseState);
applicantHelper.postApplicant(form.getId(), applicant);
List<IssueDetails> cvIssues = getIssueDetails(form);
// "CV000008");
Assert.assertTrue(cvIssues.stream().anyMatch(id -> id.getCode().equals(REQUIRED_APPLICANT_DRIVER_LICENSE_NUMBER)));
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.
the class RFA1aCoreSubmitApplicationTest method submitApplication.
private RFA1aFormDTO submitApplication() throws Exception {
RFA1aFormDTO form = formAHelper.createRFA1aForm();
ApplicantDTO applicantDTO = applicantHelper.postApplicant(form.getId(), applicantHelper.getValidApplicant());
ApplicantDTO secondApplicant = applicantHelper.getValidApplicant();
secondApplicant.setFirstName("John");
StateType driverLicenseState = new StateType();
driverLicenseState.setId("MD");
driverLicenseState.setValue("Maryland");
secondApplicant.setDriverLicenseState(driverLicenseState);
secondApplicant.getEthnicity().setId(2L);
secondApplicant.getEthnicity().setValue("American Indian");
secondApplicant = applicantHelper.postApplicant(form.getId(), secondApplicant);
residenceHelper.putResidence(form.getId(), residenceHelper.getResidenceDTO());
RFA1bFormDTO rfa1bForm = formBHelper.getRfa1bForm();
formBHelper.postRfa1bForm(form.getId(), applicantDTO.getId(), rfa1bForm);
otherAdultHelper.createOtherAdults(form.getId(), secondApplicant);
minorChildHelper.createMinorChildren(form.getId(), applicantDTO);
Response response = statusHelper.submitApplication(form.getId(), FIXTURE_PATH_TO_PRINCIPAL);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
form = formAHelper.getRFA1aForm(form.getId());
return form;
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.
the class RFAPacketResourceTest method testPacketApi.
@Test
public void testPacketApi() throws Exception {
RFA1aFormDTO form = formAHelper.createRFA1aForm();
ApplicantDTO applicantDTO = applicantHelper.postApplicant(form.getId(), applicantHelper.getValidApplicant());
ApplicantDTO secondApplicant = applicantHelper.getValidApplicant();
secondApplicant.setFirstName("John");
StateType driverLicenseState = new StateType();
driverLicenseState.setId("MD");
driverLicenseState.setValue("Maryland");
secondApplicant.setDriverLicenseState(driverLicenseState);
secondApplicant.getEthnicity().setId(2L);
secondApplicant.getEthnicity().setValue("American Indian");
secondApplicant = applicantHelper.postApplicant(form.getId(), secondApplicant);
residenceHelper.putResidence(form.getId(), residenceHelper.getResidenceDTO());
RFA1bFormDTO rfa1bForm = formBHelper.getRfa1bForm();
formBHelper.postRfa1bForm(form.getId(), applicantDTO.getId(), rfa1bForm);
otherAdultHelper.createOtherAdults(form.getId(), secondApplicant);
minorChildHelper.createMinorChildren(form.getId(), applicantDTO);
WebTarget target = clientTestRule.target(API.RFA_PACKET + "/" + form.getId() + "/" + SUMMARY);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
PacketDTO packetDTO = invocation.get(PacketDTO.class);
assertNotNull(packetDTO);
}
use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType in project cals-api by ca-cwds.
the class RFA1aPrintPDFTest method createRfa1aFormDTO.
private RFA1aFormDTO createRfa1aFormDTO() throws Exception {
RFA1aFormDTO form = formAHelper.createRFA1aForm();
ApplicantDTO applicantDTO = applicantHelper.postApplicant(form.getId(), applicantHelper.getValidApplicant());
ApplicantDTO secondApplicant = applicantHelper.getValidApplicant();
secondApplicant.setFirstName("John");
StateType driverLicenseState = new StateType();
driverLicenseState.setId("MD");
driverLicenseState.setValue("Maryland");
secondApplicant.setDriverLicenseState(driverLicenseState);
secondApplicant.getEthnicity().setId(2L);
secondApplicant.getEthnicity().setValue("American Indian");
secondApplicant = applicantHelper.postApplicant(form.getId(), secondApplicant);
residenceHelper.putResidence(form.getId(), residenceHelper.getResidenceDTO());
RFA1bFormDTO rfa1bForm = formBHelper.getRfa1bForm();
formBHelper.postRfa1bForm(form.getId(), applicantDTO.getId(), rfa1bForm);
otherAdultHelper.createOtherAdults(form.getId(), secondApplicant);
minorChildHelper.createMinorChildren(form.getId(), applicantDTO);
return form;
}
Aggregations