use of gov.ca.cwds.cals.service.dto.rfa.lic198b.LIC198bFormDTO in project cals-api by ca-cwds.
the class LIC198bResourceTest method getLIC198bFormApplicantTest.
@Test
public void getLIC198bFormApplicantTest() throws Exception {
RFA1aFormDTO form1a = formAHelper.createRFA1aForm();
LIC198bFormDTO created = getExternalEntityApiHelper().createEntity(form1a);
ApplicantDTO applicantDTO = applicantHelper.getFirstExistedOrPostNewApplicant(form1a.getId(), applicantHelper.getValidApplicant());
WebTarget target = clientTestRule.target(API.RFA_1A_FORMS + "/" + form1a.getId() + "/" + getExternalEntityApiHelper().getConfiguration().getApiPath() + "/" + API.RFA_1A_APPLICANTS + "/" + applicantDTO.getId());
LIC198bFormDTO found = target.request().get(getExternalEntityApiHelper().getConfiguration().getEntityClass());
assertThat(found).isEqualTo(created);
}
use of gov.ca.cwds.cals.service.dto.rfa.lic198b.LIC198bFormDTO in project cals-api by ca-cwds.
the class LIC198bResourceTest method getExternalEntityApiHelper.
@Override
protected BaseExternalEntityApiHelper<LIC198bFormDTO> getExternalEntityApiHelper() {
TestExternalEntityConfiguration<LIC198bFormDTO> configuration = new TestExternalEntityConfiguration<LIC198bFormDTO>(clientTestRule, LIC198bFormDTO.class, API.LIC_198B_FORMS) {
@Override
protected String getFixture() {
return LIC198B_FORM_FIXTURE;
}
@Override
public GenericType<CollectionDTO<LIC198bFormDTO>> getCollectionDTOGenericType() {
return new GenericType<CollectionDTO<LIC198bFormDTO>>() {
};
}
@Override
public void modifyEntity(LIC198bFormDTO lic198bFormDTO) {
lic198bFormDTO.getIdentifyingData().getPersonName().setFirstName("Petya");
}
};
return new BaseExternalEntityApiHelper<LIC198bFormDTO>(clientTestRule, configuration, formAHelper) {
@Override
public LIC198bFormDTO createEntity(RFA1aFormDTO form) throws IOException {
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());
LIC198bFormDTO entity = configuration.createEntity();
return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(entity, MediaType.APPLICATION_JSON_TYPE), configuration.getEntityClass());
}
};
}
Aggregations