use of org.hisp.dhis.jsonpatch.BulkJsonPatch in project dhis2-core by dhis2.
the class BulkPatchManagerTest method testApplyPatchNotShareableSchema.
@Test
void testApplyPatchNotShareableSchema() throws IOException {
final BulkJsonPatch bulkJsonPatch = loadPatch("bulk_sharing_patch_not_shareable.json", BulkJsonPatch.class);
BulkPatchParameters patchParameters = BulkPatchParameters.builder().validators(BulkPatchValidatorFactory.SHARING).build();
List<IdentifiableObject> patchedObjects = patchManager.applyPatch(bulkJsonPatch, patchParameters);
assertEquals(0, patchedObjects.size());
assertEquals(2, patchParameters.getErrorReportsCount());
assertEquals(1, patchParameters.getErrorReportsCount(ErrorCode.E3019));
assertEquals(1, patchParameters.getErrorReportsCount(ErrorCode.E4014));
}
Aggregations