Search in sources :

Example 6 with MedicalEligibilityApplication

use of gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication in project api-core by ca-cwds.

the class R02761Test method oneMedicalEligibilityApplicationNotValid.

@Test
public void oneMedicalEligibilityApplicationNotValid() throws Exception {
    List<MedicalEligibilityApplication> medicalEligibilityApplications = generateListOfValidMedicalEligibilityApplications();
    MedicalEligibilityApplication failedApplication = createMedicalEligibilityApplication(-2);
    medicalEligibilityApplications.add(failedApplication);
    clientEntityAwareDTO.getMedicalEligibilityApplications().addAll(medicalEligibilityApplications);
    checkRuleViolatedOnce(RULE_NAME);
}
Also used : MedicalEligibilityApplication(gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication) Test(org.junit.Test)

Example 7 with MedicalEligibilityApplication

use of gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication in project api-core by ca-cwds.

the class R02761Test method medicalEligibilityApplicationSameLenghthAsAge.

@Test
public void medicalEligibilityApplicationSameLenghthAsAge() throws Exception {
    MedicalEligibilityApplication application = createMedicalEligibilityApplication(0);
    clientEntityAwareDTO.getMedicalEligibilityApplications().add(application);
    checkRuleSatisfied(RULE_NAME);
}
Also used : MedicalEligibilityApplication(gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication) Test(org.junit.Test)

Example 8 with MedicalEligibilityApplication

use of gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication in project api-core by ca-cwds.

the class R02127Test method oneApplicationDateLtBirthdate.

@Test
public void oneApplicationDateLtBirthdate() throws Exception {
    List<MedicalEligibilityApplication> medicalEligibilityApplications = generateListOfValidMedicalEligibilityApplications();
    MedicalEligibilityApplication failedApplication = createMedicalEligibilityApplication(DEFAULT_BIRTHDATE.minusYears(2).plusMonths(3).plusDays(7));
    medicalEligibilityApplications.add(failedApplication);
    clientEntityAwareDTO.getMedicalEligibilityApplications().addAll(medicalEligibilityApplications);
    checkRuleViolatedOnce(RULE_NAME);
}
Also used : MedicalEligibilityApplication(gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication) Test(org.junit.Test)

Example 9 with MedicalEligibilityApplication

use of gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication in project api-core by ca-cwds.

the class R02761Test method birthDateNotSet.

@Test
public void birthDateNotSet() throws Exception {
    ChildClient client = new ChildClient();
    client.setIdentifier(CLIENT_IDENTIFIER);
    clientEntityAwareDTO.setEntity(client);
    List<MedicalEligibilityApplication> medicalEligibilityApplications = generateListOfValidMedicalEligibilityApplications();
    clientEntityAwareDTO.getMedicalEligibilityApplications().addAll(medicalEligibilityApplications);
    checkRuleSatisfied(RULE_NAME);
}
Also used : MedicalEligibilityApplication(gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication) ChildClient(gov.ca.cwds.data.legacy.cms.entity.ChildClient) Test(org.junit.Test)

Example 10 with MedicalEligibilityApplication

use of gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication in project api-core by ca-cwds.

the class R02761Test method generateListOfValidMedicalEligibilityApplications.

private static List<MedicalEligibilityApplication> generateListOfValidMedicalEligibilityApplications() {
    List<MedicalEligibilityApplication> medicalEligibilityApplications = new ArrayList<>();
    MedicalEligibilityApplication medicalEligibilityApplication1 = createMedicalEligibilityApplication(3);
    MedicalEligibilityApplication medicalEligibilityApplication2 = createMedicalEligibilityApplication(2);
    MedicalEligibilityApplication medicalEligibilityApplication3 = createMedicalEligibilityApplication(5);
    medicalEligibilityApplications.addAll(Arrays.asList(medicalEligibilityApplication1, medicalEligibilityApplication2, medicalEligibilityApplication3));
    return medicalEligibilityApplications;
}
Also used : ArrayList(java.util.ArrayList) MedicalEligibilityApplication(gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication)

Aggregations

MedicalEligibilityApplication (gov.ca.cwds.data.legacy.cms.entity.MedicalEligibilityApplication)10 Test (org.junit.Test)6 ChildClient (gov.ca.cwds.data.legacy.cms.entity.ChildClient)2 ArrayList (java.util.ArrayList)2 Client (gov.ca.cwds.data.legacy.cms.entity.Client)1