Search in sources :

Example 1 with SubstituteCareProviderCoreService

use of gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService in project api-core by ca-cwds.

the class R07045Test method setup.

@Before
public void setup() {
    scpService = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
    mockedEthnicityDao = mock(ScpOtherEthnicityDao.class);
    scpService.setScpOtherEthnicityDao(mockedEthnicityDao);
    scpService.setBusinessValidationService(mock(BusinessValidationService.class));
    scpService.setSubstituteCareProviderUcDao(mock(SubstituteCareProviderUcDao.class));
    scpService.setPlacementHomeInformationDao(mock(PlacementHomeInformationDao.class));
    scpService.setCountyOwnershipMapper(CountyOwnershipMapper.INSTANCE);
    scpService.setCountyOwnershipDao(mock(CountyOwnershipDao.class));
    scpService.setScpSsaName3Dao(mock(SsaName3Dao.class));
}
Also used : SubstituteCareProviderUcDao(gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderUcDao) SubstituteCareProviderCoreService(gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService) CountyOwnershipDao(gov.ca.cwds.cms.data.access.dao.CountyOwnershipDao) ScpOtherEthnicityDao(gov.ca.cwds.cms.data.access.dao.ScpOtherEthnicityDao) SsaName3Dao(gov.ca.cwds.cms.data.access.dao.SsaName3Dao) BusinessValidationService(gov.ca.cwds.cms.data.access.service.BusinessValidationService) PlacementHomeInformationDao(gov.ca.cwds.cms.data.access.dao.PlacementHomeInformationDao) Before(org.junit.Before)

Example 2 with SubstituteCareProviderCoreService

use of gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService in project api-core by ca-cwds.

the class SubstituteCareProviderServiceImplTest method createValidatePhoneNumberNotPersisted.

@Test
public void createValidatePhoneNumberNotPersisted() throws Exception {
    try {
        SubstituteCareProviderCoreService service = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
        SubstituteCareProvider scp = new SubstituteCareProvider();
        SCPEntityAwareDTO parameterObject = new SCPEntityAwareDTO();
        parameterObject.setEntity(scp);
        List<PhoneContactDetail> phoneNumbers = new ArrayList<>();
        PhoneContactDetail phoneContactDetail = new PhoneContactDetail();
        phoneContactDetail.setThirdId("1");
        phoneNumbers.add(phoneContactDetail);
        parameterObject.setPhoneNumbers(phoneNumbers);
        service.create(parameterObject);
        fail();
    } catch (IllegalStateException e) {
        assertEquals(String.format(ParametersValidator.INSTANCE_MUST_NOT_BE_PERSISTED, PhoneContactDetail.class.getSimpleName()), e.getMessage());
    }
}
Also used : PhoneContactDetail(gov.ca.cwds.data.legacy.cms.entity.PhoneContactDetail) SubstituteCareProviderDao(gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderDao) SubstituteCareProviderCoreService(gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService) ArrayList(java.util.ArrayList) SCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO) SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) Test(org.junit.Test)

Example 3 with SubstituteCareProviderCoreService

use of gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService in project api-core by ca-cwds.

the class SubstituteCareProviderServiceImplTest method createValidateScpNotPersistent.

@Test
public void createValidateScpNotPersistent() throws Exception {
    try {
        SubstituteCareProviderCoreService service = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
        SubstituteCareProvider scp = new SubstituteCareProvider();
        scp.setIdentifier("1");
        SCPEntityAwareDTO parameterObject = new SCPEntityAwareDTO();
        parameterObject.setEntity(scp);
        service.create(parameterObject);
        fail();
    } catch (IllegalStateException e) {
        assertEquals(String.format(ParametersValidator.INSTANCE_MUST_NOT_BE_PERSISTED, SubstituteCareProvider.class.getSimpleName()), e.getMessage());
    }
}
Also used : SubstituteCareProviderDao(gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderDao) SubstituteCareProviderCoreService(gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService) SCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO) SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) Test(org.junit.Test)

Example 4 with SubstituteCareProviderCoreService

use of gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService in project api-core by ca-cwds.

the class BaseDocToolRulesSubstituteCareProviderTest method setUp.

@Before
public void setUp() {
    businessValidationService = new BusinessValidationService(droolsService);
    SCPEntityAwareDTO scpEntityAwareDTO = new SCPEntityAwareDTO();
    entityAwareDTO = new ExtendedSCPEntityAwareDTO(scpEntityAwareDTO);
    PlacementHomeInformation placementHomeInformation = new PlacementHomeInformation();
    entityAwareDTO.setPlacementHomeInformation(placementHomeInformation);
    scpService = new SubstituteCareProviderCoreService(mock(SubstituteCareProviderDao.class));
    entityAwareDTO.setEntity(new SubstituteCareProvider());
}
Also used : SubstituteCareProviderCoreService(gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService) SCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO) ExtendedSCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO) BusinessValidationService(gov.ca.cwds.cms.data.access.service.BusinessValidationService) ExtendedSCPEntityAwareDTO(gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO) PlacementHomeInformation(gov.ca.cwds.data.legacy.cms.entity.PlacementHomeInformation) SubstituteCareProvider(gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider) Before(org.junit.Before)

Aggregations

SubstituteCareProviderCoreService (gov.ca.cwds.cms.data.access.service.impl.SubstituteCareProviderCoreService)4 SCPEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.SCPEntityAwareDTO)3 SubstituteCareProvider (gov.ca.cwds.data.legacy.cms.entity.SubstituteCareProvider)3 SubstituteCareProviderDao (gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderDao)2 BusinessValidationService (gov.ca.cwds.cms.data.access.service.BusinessValidationService)2 Before (org.junit.Before)2 Test (org.junit.Test)2 CountyOwnershipDao (gov.ca.cwds.cms.data.access.dao.CountyOwnershipDao)1 PlacementHomeInformationDao (gov.ca.cwds.cms.data.access.dao.PlacementHomeInformationDao)1 ScpOtherEthnicityDao (gov.ca.cwds.cms.data.access.dao.ScpOtherEthnicityDao)1 SsaName3Dao (gov.ca.cwds.cms.data.access.dao.SsaName3Dao)1 SubstituteCareProviderUcDao (gov.ca.cwds.cms.data.access.dao.SubstituteCareProviderUcDao)1 ExtendedSCPEntityAwareDTO (gov.ca.cwds.cms.data.access.dto.ExtendedSCPEntityAwareDTO)1 PhoneContactDetail (gov.ca.cwds.data.legacy.cms.entity.PhoneContactDetail)1 PlacementHomeInformation (gov.ca.cwds.data.legacy.cms.entity.PlacementHomeInformation)1 ArrayList (java.util.ArrayList)1