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))));
}
Aggregations