Search in sources :

Example 6 with RuleEnrollment

use of org.hisp.dhis.rules.models.RuleEnrollment in project dhis2-core by dhis2.

the class ProgramRuleEntityMapperServiceTest method testMappedEnrollment.

@Test
void testMappedEnrollment() {
    RuleEnrollment ruleEnrollment = subject.toMappedRuleEnrollment(programInstance, Collections.emptyList());
    assertEquals(ruleEnrollment.enrollment(), programInstance.getUid());
    assertEquals(ruleEnrollment.organisationUnit(), programInstance.getOrganisationUnit().getUid());
    assertEquals(ruleEnrollment.attributeValues().size(), 1);
    assertEquals(ruleEnrollment.attributeValues().get(0).value(), SAMPLE_VALUE_A);
}
Also used : RuleEnrollment(org.hisp.dhis.rules.models.RuleEnrollment) Test(org.junit.jupiter.api.Test) DhisConvenienceTest(org.hisp.dhis.DhisConvenienceTest)

Aggregations

RuleEnrollment (org.hisp.dhis.rules.models.RuleEnrollment)6 Test (org.junit.Test)5 Date (java.util.Date)2 RuleEvent (org.hisp.dhis.rules.models.RuleEvent)2 RuleVariable (org.hisp.dhis.rules.models.RuleVariable)2 DhisConvenienceTest (org.hisp.dhis.DhisConvenienceTest)1 RuleDataValue (org.hisp.dhis.rules.models.RuleDataValue)1 Test (org.junit.jupiter.api.Test)1