use of gov.ca.cwds.cals.service.dto.rfa.RFA1bFormDTO 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.service.dto.rfa.RFA1bFormDTO 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.service.dto.rfa.RFA1bFormDTO in project cals-api by ca-cwds.
the class ApplicantHelper method getValidApplicant.
public ApplicantDTO getValidApplicant() throws IOException {
ApplicantDTO applicant = getApplicantDTO();
RFA1bFormDTO rfa1bForm = new FormBHelper(clientTestRule).getRfa1bForm();
applicant.setRfa1bForm(rfa1bForm);
return applicant;
}
use of gov.ca.cwds.cals.service.dto.rfa.RFA1bFormDTO 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;
}
use of gov.ca.cwds.cals.service.dto.rfa.RFA1bFormDTO in project cals-api by ca-cwds.
the class RFA1bResourceTest method getExternalEntityApiHelper.
@Override
protected BaseExternalEntityApiHelper<RFA1bFormDTO> getExternalEntityApiHelper() {
TestExternalEntityConfiguration<RFA1bFormDTO> configuration = new TestExternalEntityConfiguration<RFA1bFormDTO>(clientTestRule, RFA1bFormDTO.class, API.RFA_1B_FORMS) {
@Override
protected String getFixture() {
return RFA1B_FORM_FIXTURE;
}
@Override
public GenericType<CollectionDTO<RFA1bFormDTO>> getCollectionDTOGenericType() {
return new GenericType<CollectionDTO<RFA1bFormDTO>>() {
};
}
@Override
public void modifyEntity(RFA1bFormDTO rfa1bFormDTO) {
rfa1bFormDTO.setApplicantFirstName("Petya");
}
};
return new BaseExternalEntityApiHelper<RFA1bFormDTO>(clientTestRule, configuration, formAHelper) {
@Override
public RFA1bFormDTO createEntity(RFA1aFormDTO form) throws Exception {
ApplicantDTO applicantDTO = applicantHelper.getFirstExistedOrPostNewApplicant(form.getId(), applicantHelper.getValidApplicant());
WebTarget target = clientTestRule.target(API.RFA_1A_FORMS + "/" + form.getId() + "/" + configuration.getApiPath() + "/" + API.RFA_1A_APPLICANTS + "/" + applicantDTO.getId());
RFA1bFormDTO entity = configuration.createEntity();
return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(entity, MediaType.APPLICATION_JSON_TYPE), configuration.getEntityClass());
}
public void getEntitiesByFormId() throws Exception {
}
};
}
Aggregations