Search in sources :

Example 1 with DataIntegrityCheckType

use of org.hisp.dhis.dataintegrity.DataIntegrityCheckType in project dhis2-core by dhis2.

the class DataIntegrityDetailsControllerTest method testLegacyChecksOnly.

@Test
void testLegacyChecksOnly() {
    for (DataIntegrityCheckType type : DataIntegrityCheckType.values()) {
        String check = type.getName();
        postDetails(check);
        JsonDataIntegrityDetails details = getDetails(check);
        assertTrue(details.getIssues().isEmpty());
    }
}
Also used : JsonDataIntegrityDetails(org.hisp.dhis.webapi.json.domain.JsonDataIntegrityDetails) DataIntegrityCheckType(org.hisp.dhis.dataintegrity.DataIntegrityCheckType) Test(org.junit.jupiter.api.Test)

Example 2 with DataIntegrityCheckType

use of org.hisp.dhis.dataintegrity.DataIntegrityCheckType in project dhis2-core by dhis2.

the class DataIntegritySummaryControllerTest method testLegacyChecksHaveSummary.

@Test
void testLegacyChecksHaveSummary() {
    for (DataIntegrityCheckType type : DataIntegrityCheckType.values()) {
        String check = type.getName();
        postSummary(check);
        JsonDataIntegritySummary summary = getSummary(check);
        assertTrue(summary.getCount() >= 0, "summary threw an exception");
    }
}
Also used : DataIntegrityCheckType(org.hisp.dhis.dataintegrity.DataIntegrityCheckType) JsonDataIntegritySummary(org.hisp.dhis.webapi.json.domain.JsonDataIntegritySummary) Test(org.junit.jupiter.api.Test)

Example 3 with DataIntegrityCheckType

use of org.hisp.dhis.dataintegrity.DataIntegrityCheckType in project dhis2-core by dhis2.

the class DataIntegrityChecksControllerTest method testGetAvailableChecks.

@Test
void testGetAvailableChecks() {
    JsonList<JsonDataIntegrityCheck> checks = GET("/dataIntegrity").content().asList(JsonDataIntegrityCheck.class);
    assertFalse(checks.isEmpty());
    assertCheckExists("categories_no_options", checks);
    assertCheckExists("categories_one_default_category", checks);
    assertCheckExists("categories_one_default_category_option", checks);
    assertCheckExists("categories_one_default_category_combo", checks);
    assertCheckExists("categories_one_default_category_option_combo", checks);
    assertCheckExists("categories_unique_category_combo", checks);
    for (DataIntegrityCheckType type : DataIntegrityCheckType.values()) {
        assertCheckExists(type.getName(), checks);
    }
}
Also used : JsonDataIntegrityCheck(org.hisp.dhis.webapi.json.domain.JsonDataIntegrityCheck) DataIntegrityCheckType(org.hisp.dhis.dataintegrity.DataIntegrityCheckType) Test(org.junit.jupiter.api.Test)

Aggregations

DataIntegrityCheckType (org.hisp.dhis.dataintegrity.DataIntegrityCheckType)3 Test (org.junit.jupiter.api.Test)3 JsonDataIntegrityCheck (org.hisp.dhis.webapi.json.domain.JsonDataIntegrityCheck)1 JsonDataIntegrityDetails (org.hisp.dhis.webapi.json.domain.JsonDataIntegrityDetails)1 JsonDataIntegritySummary (org.hisp.dhis.webapi.json.domain.JsonDataIntegritySummary)1