use of org.hisp.dhis.webapi.json.domain.JsonDataIntegritySummary in project dhis2-core by dhis2.
the class DataIntegrityCategoriesControllerTest method testSummaryCategories_no_options.
@Test
void testSummaryCategories_no_options() {
assertStatus(HttpStatus.CREATED, POST("/categories", "{'name': 'CatDog', 'shortName': 'CD', 'dataDimensionType': 'ATTRIBUTE'}"));
postSummary("categories-no-options");
JsonDataIntegritySummary summary = getSummary("categories-no-options");
assertEquals(1, summary.getCount());
assertEquals(50, summary.getPercentage().intValue());
}
use of org.hisp.dhis.webapi.json.domain.JsonDataIntegritySummary in project dhis2-core by dhis2.
the class DataIntegrityCategoriesControllerTest method testSummaryCategories_one_default_category.
/**
* Ideally we would have created a second category named default, but we
* have made this impossible by unique constraint. So the best we can do is
* changing the UID of the existing default to some other UID.
*/
@Test
void testSummaryCategories_one_default_category() {
String uid = CodeGenerator.generateUid();
assertEquals(uid, updateDefaultCategoryToUid(uid));
postSummary("categories_one_default_category");
JsonDataIntegritySummary summary = getSummary("categories_one_default_category");
assertEquals(1, summary.getCount());
assertNull(summary.getPercentage());
}
use of org.hisp.dhis.webapi.json.domain.JsonDataIntegritySummary in project dhis2-core by dhis2.
the class DataIntegrityCategoriesControllerTest method testSummaryCategories_one_default_category_combo.
/**
* Ideally we would have created a second category combo named default, but
* we have made this impossible by unique constraint. So the best we can do
* is changing the UID of the existing default to some other UID.
*/
@Test
void testSummaryCategories_one_default_category_combo() {
String uid = CodeGenerator.generateUid();
assertEquals(uid, updateDefaultCategoryComboToUid(uid));
postSummary("categories_one_default_category_combo");
JsonDataIntegritySummary summary = getSummary("categories_one_default_category_combo");
assertEquals(1, summary.getCount());
assertNull(summary.getPercentage());
}
Aggregations