use of org.hisp.dhis.rules.models.RuleValidationResult in project dhis2-core by dhis2.
the class ProgramRuleEngineDescriptionTest method testProgramRuleWithLiterals.
@Test
void testProgramRuleWithLiterals() {
RuleValidationResult result = validateRuleCondition(conditionLiteralString, program);
assertNotNull(result);
assertEquals("1 > 2", result.getDescription());
assertTrue(result.isValid());
}
use of org.hisp.dhis.rules.models.RuleValidationResult in project dhis2-core by dhis2.
the class ProgramRuleEngineDescriptionTest method testProgramRuleWithTextDataElement.
@Test
void testProgramRuleWithTextDataElement() {
RuleValidationResult result = validateRuleCondition(programRuleTextDE.getCondition(), program);
assertNotNull(result);
assertEquals("DataElementD == 'text_de'", result.getDescription());
assertTrue(result.isValid());
}
use of org.hisp.dhis.rules.models.RuleValidationResult in project dhis2-core by dhis2.
the class ProgramRuleEngineServiceTest method testGetDescription.
@Test
void testGetDescription() {
RuleValidationResult result = RuleValidationResult.builder().isValid(true).build();
when(programRuleService.getProgramRule(anyString())).thenReturn(programRuleA);
when(programRuleEngine.getDescription(programRuleA.getCondition(), program)).thenReturn(result);
assertNotNull(result);
assertTrue(result.isValid());
}
Aggregations