Search in sources :

Example 1 with H2DhisConfigurationProvider

use of org.hisp.dhis.config.H2DhisConfigurationProvider in project dhis2-core by dhis2.

the class TeTaValidationTest method testEncryptedAttrFail.

@Test
void testEncryptedAttrFail() throws IOException {
    setUpMetadata("tracker/validations/te-program_with_tea_encryption_metadata.json");
    TrackerImportParams trackerImportParams = createBundleFromJson("tracker/validations/te-program_with_tea_encryption_data.json");
    H2DhisConfigurationProvider dhisConfigurationProvider = (H2DhisConfigurationProvider) this.dhisConfigurationProvider;
    dhisConfigurationProvider.setEncryptionStatus(EncryptionStatus.MISSING_ENCRYPTION_PASSWORD);
    TrackerImportReport trackerImportReport = trackerImportService.importTracker(trackerImportParams);
    assertEquals(1, trackerImportReport.getValidationReport().getErrors().size());
    assertThat(trackerImportReport.getValidationReport().getErrors(), everyItem(hasProperty("errorCode", equalTo(TrackerErrorCode.E1112))));
}
Also used : TrackerImportParams(org.hisp.dhis.tracker.TrackerImportParams) TrackerImportReport(org.hisp.dhis.tracker.report.TrackerImportReport) H2DhisConfigurationProvider(org.hisp.dhis.config.H2DhisConfigurationProvider) Test(org.junit.jupiter.api.Test)

Aggregations

H2DhisConfigurationProvider (org.hisp.dhis.config.H2DhisConfigurationProvider)1 TrackerImportParams (org.hisp.dhis.tracker.TrackerImportParams)1 TrackerImportReport (org.hisp.dhis.tracker.report.TrackerImportReport)1 Test (org.junit.jupiter.api.Test)1