use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateFailureNoPeriods.
@Test
void validateFailureNoPeriods() {
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())).addFilter(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(deA, inA))).build();
assertValidatonError(ErrorCode.E7104, params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateFailureReportingRatesAndDataElementGroupSetAsDimensions.
@Test
void validateFailureReportingRatesAndDataElementGroupSetAsDimensions() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(rrA, inA))).addDimension(new BaseDimensionalObject(dgsA.getDimension(), DimensionType.DATA_ELEMENT_GROUP_SET, getList(deA))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).build();
assertValidatonError(ErrorCode.E7112, params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateSuccessSkipTotalDataElementsWithCategoryFilter.
/**
* 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 filters.
*/
@Test
void validateSuccessSkipTotalDataElementsWithCategoryFilter() {
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))).addFilter(new BaseDimensionalObject(caB.getDimension(), DimensionType.CATEGORY, getList(coD))).build();
queryValidator.validate(params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateFailureValueType.
@Test
void validateFailureValueType() {
deB.setValueType(ValueType.FILE_RESOURCE);
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(deA, deB))).addDimension(new BaseDimensionalObject(ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, getList(ouA, ouB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).build();
assertValidatonError(ErrorCode.E7115, params);
}
use of org.hisp.dhis.common.BaseDimensionalObject in project dhis2-core by dhis2.
the class QueryValidatorTest method validateMissingOrgUnitDimensionOutputFormatDataValueSet.
@Test
void validateMissingOrgUnitDimensionOutputFormatDataValueSet() {
DataQueryParams params = DataQueryParams.newBuilder().addDimension(new BaseDimensionalObject(DATA_X_DIM_ID, DimensionType.DATA_X, getList(deA, deB))).addDimension(new BaseDimensionalObject(PERIOD_DIM_ID, DimensionType.PERIOD, getList(peA, peB))).withOutputFormat(OutputFormat.DATA_VALUE_SET).build();
assertValidatonError(ErrorCode.E7119, params);
}
Aggregations