Search in sources :

Example 1 with CountyType

use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.CountyType in project cals-api by ca-cwds.

the class RFA1cResourceTest method getExternalEntityApiHelper.

@Override
protected BaseExternalEntityApiHelper<RFA1cFormDTO> getExternalEntityApiHelper() {
    TestExternalEntityConfiguration<RFA1cFormDTO> configuration = new TestExternalEntityConfiguration<RFA1cFormDTO>(clientTestRule, RFA1cFormDTO.class, API.RFA_1C_FORMS) {

        @Override
        protected String getFixture() {
            return FRA1C_FORM_FIXTURE;
        }

        @Override
        public GenericType<CollectionDTO<RFA1cFormDTO>> getCollectionDTOGenericType() {
            return new GenericType<CollectionDTO<RFA1cFormDTO>>() {
            };
        }

        @Override
        public void modifyEntity(RFA1cFormDTO rfa1cFormDTO) {
            CountyType applicationCounty = new CountyType();
            applicationCounty.setId(35L);
            applicationCounty.setValue("San Benito");
            rfa1cFormDTO.setApplicationCounty(applicationCounty);
        }
    };
    return new BaseExternalEntityApiHelper<RFA1cFormDTO>(clientTestRule, configuration, formAHelper) {

        @Override
        public RFA1cFormDTO createEntity(RFA1aFormDTO form) throws Exception {
            RFA1cFormDTO rfa1cFormDTO = super.createEntity(form);
            try {
                super.createEntity(form);
                Assert.fail();
            } catch (BadRequestException e) {
            // ok
            }
            return rfa1cFormDTO;
        }

        @Override
        public void getEntitiesByFormId() throws Exception {
        }
    };
}
Also used : GenericType(javax.ws.rs.core.GenericType) RFA1cFormDTO(gov.ca.cwds.cals.service.dto.rfa.RFA1cFormDTO) RFA1aFormDTO(gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO) BadRequestException(javax.ws.rs.BadRequestException) CollectionDTO(gov.ca.cwds.cals.service.dto.rfa.collection.CollectionDTO) CountyType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.CountyType) TestExternalEntityConfiguration(gov.ca.cwds.cals.web.rest.rfa.configuration.TestExternalEntityConfiguration)

Example 2 with CountyType

use of gov.ca.cwds.cals.persistence.model.calsns.dictionaries.CountyType in project cals-api by ca-cwds.

the class FormAHelper method createRfa1aForm.

public RFA1aFormDTO createRfa1aForm() throws Exception {
    RFA1aFormDTO form = new RFA1aFormDTO();
    CountyType county = new CountyType();
    county.setId(34L);
    county.setValue("Sacramento");
    form.setApplicationCounty(county);
    form.setInitialApplication(false);
    form.setOtherTypeDescription("otherDescription");
    return form;
}
Also used : RFA1aFormDTO(gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO) CountyType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.CountyType)

Aggregations

CountyType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.CountyType)2 RFA1aFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO)2 RFA1cFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1cFormDTO)1 CollectionDTO (gov.ca.cwds.cals.service.dto.rfa.collection.CollectionDTO)1 TestExternalEntityConfiguration (gov.ca.cwds.cals.web.rest.rfa.configuration.TestExternalEntityConfiguration)1 BadRequestException (javax.ws.rs.BadRequestException)1 GenericType (javax.ws.rs.core.GenericType)1