use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateFailureNoDataItems.
@Test
void validateFailureNoDataItems() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList())).build();
assertValidatonError(ErrorCode.E7102, params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateFailureSingleProgramIndicatorAsFilter.
@Test
void validateFailureSingleProgramIndicatorAsFilter() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).addFilter(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.PROGRAM_INDICATOR, getList(deA, inA))).build();
assertValidatonError(ErrorCode.E7108, params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateErrorMultipleIndicatorsFilter.
@Test
void validateErrorMultipleIndicatorsFilter() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).addFilter(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(inA, inB))).build();
ErrorMessage error = queryValidator.validateForErrorMessage(params);
assertEquals(ErrorCode.E7108, error.getErrorCode());
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateSuccessSkipTotalWithOperands.
/**
* Asserts that the total value can be retrieved for data element operands
* with data elements category combinations with skip total enabled.
*/
@Test
void validateSuccessSkipTotalWithOperands() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(doC, doD))).addFilter(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).build();
queryValidator.validate(params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateSuccessSkipTotalDataElementsWithCategoryDimension.
/**
* Asserts that the total value can be retrieved for data elements with
* category combinations with skip total enabled if the query specifies all
* categories of the category combination with items as dimensions.
*/
@Test
void validateSuccessSkipTotalDataElementsWithCategoryDimension() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(deA, deC))).addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA))).addDimension(new BaseDimensionalObject(caB.getDimension(), DimensionType.CATEGORY, getList(coC))).build();
queryValidator.validate(params);
}
Aggregations