Search in sources :

Example 46 with DimensionalItemId

use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.

the class DataElementGroupResolverTest method verifyExpressionIsNotResolvedWhenDeGroupPrefixNotInUid0.

@Test
void verifyExpressionIsNotResolvedWhenDeGroupPrefixNotInUid0() {
    // arrange
    dimensionalItemId = new DimensionalItemId(DimensionItemType.DATA_ELEMENT_OPERAND, uid1, uid2, uid3, createIndicatorExpression());
    String expression = createIndicatorExpression();
    when(expressionService.getExpressionDimensionalItemIds(expression, INDICATOR_EXPRESSION)).thenReturn(Sets.newHashSet(dimensionalItemId));
    // act
    String resolvedExpression = resolver.resolve(expression);
    // assert
    assertEquals(expression, resolvedExpression);
}
Also used : DimensionalItemId(org.hisp.dhis.common.DimensionalItemId) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test)

Aggregations

DimensionalItemId (org.hisp.dhis.common.DimensionalItemId)46 Test (org.junit.jupiter.api.Test)32 DimensionalItemObject (org.hisp.dhis.common.DimensionalItemObject)21 DhisSpringTest (org.hisp.dhis.DhisSpringTest)13 Indicator (org.hisp.dhis.indicator.Indicator)12 ProgramIndicator (org.hisp.dhis.program.ProgramIndicator)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)12 HashMap (java.util.HashMap)11 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)9 DataElementOperand (org.hisp.dhis.dataelement.DataElementOperand)9 IndicatorValue (org.hisp.dhis.indicator.IndicatorValue)8 IndicatorType (org.hisp.dhis.indicator.IndicatorType)6 DataElement (org.hisp.dhis.dataelement.DataElement)5 List (java.util.List)4 BaseDimensionalItemObject (org.hisp.dhis.common.BaseDimensionalItemObject)4 Period (org.hisp.dhis.period.Period)4 ArrayList (java.util.ArrayList)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 AllArgsConstructor (lombok.AllArgsConstructor)3