Search in sources :

Example 6 with ChildClient

use of gov.ca.cwds.data.persistence.cms.ChildClient in project API by ca-cwds.

the class ChildClientDaoIT method testCreate.

/**
   * Create JUnit test
   */
@Override
@Test
public void testCreate() throws Exception {
    ChildClient vchc = validChildClient();
    ChildClient childClient = new ChildClient("1234567ABC", vchc.getAdoptableCode(), vchc.getAdoptedAge(), vchc.getAfdcFcEligibilityIndicatorVar(), vchc.getAllEducationInfoOnFileIndicator(), vchc.getAllHealthInfoOnFileIndicator(), vchc.getAttemptToAcquireEducInfoDesc(), vchc.getAttemptToAcquireHlthInfoDesc(), vchc.getAwolAbductedCode(), vchc.getBirthHistoryIndicatorVar(), vchc.getChildIndianAncestryIndicator(), vchc.getCollegeIndicator(), vchc.getCurrentCaseId(), vchc.getDeathCircumstancesType(), vchc.getDisabilityDiagnosedCode(), vchc.getDrmsHePassportDocOld(), vchc.getDrmsHealthEducPassportDoc(), vchc.getDrmsVoluntaryPlcmntAgrmntDoc(), vchc.getFc2EligApplicationIndicatorVar(), vchc.getFoodStampsApplicationDate(), vchc.getFoodStampsApplicationIndicator(), vchc.getIcwaEligibilityCode(), vchc.getIntercountryAdoptDisruptedIndicator(), vchc.getIntercountryAdoptDissolvedIndicator(), vchc.getMedEligibilityApplicationIndicatorVar(), vchc.getMinorNmdParentIndicator(), vchc.getParentalRightsLimitedIndicator(), vchc.getParentalRightsTermintnIndicatorVar(), vchc.getPaternityIndividualIndicatorVar(), vchc.getPostsecVocIndicator(), vchc.getPreviouslyAdoptedCode(), vchc.getSafelySurrendedBabiesIndicatorVar(), vchc.getSaw1EligApplicationIndicatorVar(), vchc.getSawsCaseSerialNumber(), vchc.getSijsScheduledInterviewDate(), vchc.getSiiNextScreeningDueDate(), vchc.getSsiSspApplicationIndicator(), vchc.getTribalAncestryNotifctnIndicatorVar(), vchc.getTribalCustomaryAdoptionDate(), vchc.getTribalCustomaryAdoptionIndicator());
    ChildClient create = childClientDao.create(childClient);
    assertThat(childClient, is(create));
}
Also used : ChildClient(gov.ca.cwds.data.persistence.cms.ChildClient) Test(org.junit.Test)

Example 7 with ChildClient

use of gov.ca.cwds.data.persistence.cms.ChildClient in project API by ca-cwds.

the class ChildClientDaoIT method testUpdateEntityNotFoundException.

@Override
@Test
public void testUpdateEntityNotFoundException() throws Exception {
    thrown.expect(EntityNotFoundException.class);
    ChildClient vchc = validChildClient();
    ChildClient pers = new ChildClient("AbNNjTK0P1", vchc.getAdoptableCode(), vchc.getAdoptedAge(), vchc.getAfdcFcEligibilityIndicatorVar(), vchc.getAllEducationInfoOnFileIndicator(), vchc.getAllHealthInfoOnFileIndicator(), vchc.getAttemptToAcquireEducInfoDesc(), vchc.getAttemptToAcquireHlthInfoDesc(), vchc.getAwolAbductedCode(), vchc.getBirthHistoryIndicatorVar(), vchc.getChildIndianAncestryIndicator(), vchc.getCollegeIndicator(), vchc.getCurrentCaseId(), vchc.getDeathCircumstancesType(), vchc.getDisabilityDiagnosedCode(), vchc.getDrmsHePassportDocOld(), vchc.getDrmsHealthEducPassportDoc(), vchc.getDrmsVoluntaryPlcmntAgrmntDoc(), vchc.getFc2EligApplicationIndicatorVar(), vchc.getFoodStampsApplicationDate(), vchc.getFoodStampsApplicationIndicator(), vchc.getIcwaEligibilityCode(), vchc.getIntercountryAdoptDisruptedIndicator(), vchc.getIntercountryAdoptDissolvedIndicator(), vchc.getMedEligibilityApplicationIndicatorVar(), vchc.getMinorNmdParentIndicator(), vchc.getParentalRightsLimitedIndicator(), vchc.getParentalRightsTermintnIndicatorVar(), vchc.getPaternityIndividualIndicatorVar(), vchc.getPostsecVocIndicator(), vchc.getPreviouslyAdoptedCode(), vchc.getSafelySurrendedBabiesIndicatorVar(), vchc.getSaw1EligApplicationIndicatorVar(), vchc.getSawsCaseSerialNumber(), vchc.getSijsScheduledInterviewDate(), vchc.getSiiNextScreeningDueDate(), vchc.getSsiSspApplicationIndicator(), vchc.getTribalAncestryNotifctnIndicatorVar(), vchc.getTribalCustomaryAdoptionDate(), vchc.getTribalCustomaryAdoptionIndicator());
    childClientDao.update(pers);
}
Also used : ChildClient(gov.ca.cwds.data.persistence.cms.ChildClient) Test(org.junit.Test)

Example 8 with ChildClient

use of gov.ca.cwds.data.persistence.cms.ChildClient in project API by ca-cwds.

the class ChildClientDaoIT method testDeleteEntityNotFoundException.

@Override
@Test
public void testDeleteEntityNotFoundException() throws Exception {
    ChildClient deleted = childClientDao.delete("9999999ZZZ");
    assertThat(deleted, is(nullValue()));
}
Also used : ChildClient(gov.ca.cwds.data.persistence.cms.ChildClient) Test(org.junit.Test)

Example 9 with ChildClient

use of gov.ca.cwds.data.persistence.cms.ChildClient in project API by ca-cwds.

the class ChildClientDaoIT method testFindEntityNotFoundException.

@Override
@Test
public void testFindEntityNotFoundException() throws Exception {
    ChildClient found = childClientDao.find("9999999ZZZ");
    assertThat(found, is(nullValue()));
}
Also used : ChildClient(gov.ca.cwds.data.persistence.cms.ChildClient) Test(org.junit.Test)

Example 10 with ChildClient

use of gov.ca.cwds.data.persistence.cms.ChildClient in project API by ca-cwds.

the class ChildClientDaoIT method testDelete.

/**
   * Delete JUnit test
   */
@Override
@Test
public void testDelete() throws Exception {
    ChildClient deleted = childClientDao.delete(victimId);
    assertThat(deleted.getVictimClientId(), is(victimId));
}
Also used : ChildClient(gov.ca.cwds.data.persistence.cms.ChildClient) Test(org.junit.Test)

Aggregations

ChildClient (gov.ca.cwds.data.persistence.cms.ChildClient)10 Test (org.junit.Test)8 ServiceException (gov.ca.cwds.rest.services.ServiceException)2 EntityExistsException (javax.persistence.EntityExistsException)1 EntityNotFoundException (javax.persistence.EntityNotFoundException)1