use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.
the class CategoryOptionResolverTest method verifyExpressionIsResolvedProperly.
@Test
void verifyExpressionIsResolvedProperly() {
// arrange
dimensionalItemId = new DimensionalItemId(DimensionItemType.DATA_ELEMENT_OPERAND, uid1, CATEGORY_OPTION_PREFIX + uid2, uid3, createIndicatorExpression());
String expression = createIndicatorExpression();
when(expressionService.getExpressionDimensionalItemIds(expression, INDICATOR_EXPRESSION)).thenReturn(Sets.newHashSet(dimensionalItemId));
// act
String resolvedExpression = resolver.resolve(expression);
// assert
assertResolvedExpressionEquals(resolvedExpression, coc1.getUid(), coc2.getUid(), coc3.getUid());
}
use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.
the class CategoryOptionGroupResolverTest method verifyExpressionIsResolvedProperly.
@Test
void verifyExpressionIsResolvedProperly() {
// arrange
dimensionalItemId = new DimensionalItemId(DimensionItemType.DATA_ELEMENT_OPERAND, uid1, CATEGORY_OPTION_GROUP_PREFIX + uid2, uid3, createIndicatorExpression());
String expression = createIndicatorExpression();
when(expressionService.getExpressionDimensionalItemIds(expression, INDICATOR_EXPRESSION)).thenReturn(Sets.newHashSet(dimensionalItemId));
// act
String resolvedExpression = resolver.resolve(expression);
// assert
assertResolvedExpressionEquals(resolvedExpression, coc1.getUid(), coc2.getUid(), coc3.getUid());
}
use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.
the class CategoryOptionGroupResolverTest method verifyExpressionIsNotResolvedWhenDimensionalItemIdHasNoItem.
@Test
void verifyExpressionIsNotResolvedWhenDimensionalItemIdHasNoItem() {
// arrange
dimensionalItemId = new DimensionalItemId(DimensionItemType.DATA_ELEMENT_OPERAND, uid1, CATEGORY_OPTION_GROUP_PREFIX + uid2, uid3);
String expression = createIndicatorExpression();
when(expressionService.getExpressionDimensionalItemIds(expression, INDICATOR_EXPRESSION)).thenReturn(Sets.newHashSet(dimensionalItemId));
// act
String resolvedExpression = resolver.resolve(expression);
// assert
assertEquals(expression, resolvedExpression);
}
use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.
the class CategoryOptionGroupResolverTest method verifyExpressionIsNotResolvedWhenCoPrefixNotInUid1.
@Test
void verifyExpressionIsNotResolvedWhenCoPrefixNotInUid1() {
// 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);
}
use of org.hisp.dhis.common.DimensionalItemId in project dhis2-core by dhis2.
the class DataElementGroupResolverTest method verifyExpressionIsNotResolvedWhenDimensionalItemIdHasNoItem.
@Test
void verifyExpressionIsNotResolvedWhenDimensionalItemIdHasNoItem() {
// arrange
dimensionalItemId = new DimensionalItemId(DimensionItemType.DATA_ELEMENT_OPERAND, DATA_ELEMENT_GROUP_PREFIX + uid1, uid2, uid3);
String expression = createIndicatorExpression();
when(expressionService.getExpressionDimensionalItemIds(expression, INDICATOR_EXPRESSION)).thenReturn(Sets.newHashSet(dimensionalItemId));
// act
String resolvedExpression = resolver.resolve(expression);
// assert
assertEquals(expression, resolvedExpression);
}
Aggregations