use of org.hisp.dhis.validation.comparator.ValidationResultQuery in project dhis2-core by dhis2.
the class ValidationResultStoreHqlTest method queryWithUserWithCategoryOptionGroupSet.
@Test
void queryWithUserWithCategoryOptionGroupSet() {
CategoryOptionGroupSet groupSet = new CategoryOptionGroupSet();
groupSet.setId(42L);
setUpUser("orgUid", null, groupSet);
store.query(new ValidationResultQuery());
assertHQLMatches("from ValidationResult vr where (locate('orgUid',vr.organisationUnit.path) <> 0) and 1 = ...", 544);
}
use of org.hisp.dhis.validation.comparator.ValidationResultQuery in project dhis2-core by dhis2.
the class ValidationResultStoreHqlTest method queryWithOrgUnitFilter.
@Test
void queryWithOrgUnitFilter() {
ValidationResultQuery query = new ValidationResultQuery();
query.setOu(asList("uid1", "uid2"));
store.query(query);
assertHQLMatches("from ValidationResult vr where vr.organisationUnit.uid in :orgUnitsUids ");
assertHQLParameter("orgUnitsUids", asList("uid1", "uid2"));
assertHQLParameterCount(1);
}
use of org.hisp.dhis.validation.comparator.ValidationResultQuery in project dhis2-core by dhis2.
the class ValidationResultStoreHqlTest method queryWithValidationRuleFilter.
@Test
void queryWithValidationRuleFilter() {
ValidationResultQuery query = new ValidationResultQuery();
query.setVr(asList("uid1", "uid2"));
store.query(query);
assertHQLMatches("from ValidationResult vr where vr.validationRule.uid in :validationRulesUids ");
assertHQLParameter("validationRulesUids", asList("uid1", "uid2"));
assertHQLParameterCount(1);
}
use of org.hisp.dhis.validation.comparator.ValidationResultQuery in project dhis2-core by dhis2.
the class ValidationResultStoreHqlTest method queryWithIsoPeriodFilter.
@Test
void queryWithIsoPeriodFilter() {
ValidationResultQuery query = new ValidationResultQuery();
query.setPe(singletonList("2017Q1"));
store.query(query);
assertHQLMatches("from ValidationResult vr where( ((vr.period.startDate <= :periodId1End ) and (vr.period.endDate >= :periodId1Start )))");
PeriodType quarterly = PeriodType.getByNameIgnoreCase(DateUnitType.QUARTERLY.getName());
Period q1_2017 = quarterly.createPeriod("2017Q1");
assertNotNull(q1_2017);
assertHQLParameter("periodId1Start", q1_2017.getStartDate());
assertHQLParameter("periodId1End", q1_2017.getEndDate());
assertHQLParameterCount(2);
}
use of org.hisp.dhis.validation.comparator.ValidationResultQuery in project dhis2-core by dhis2.
the class ValidationResultStoreHqlTest method queryWithUserWithCategory.
@Test
void queryWithUserWithCategory() {
Category category = new Category();
category.setId(42L);
setUpUser("orgUid", category, null);
store.query(new ValidationResultQuery());
assertHQLMatches("from ValidationResult vr where (locate('orgUid',vr.organisationUnit.path) <> 0) and 1 = ...", 523);
}
Aggregations