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));
}
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());
}
}
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());
}
}
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());
}
Aggregations