@Test public void test_permission_violation(){ ExampleFactoryPermission currentModel = new ExampleFactoryPermission(); currentModel.stringAttribute.set("123"); currentModel=currentModel.internal().finalise(); ExampleFactoryPermission originalModel = currentModel.internal().copy(); ExampleFactoryPermission newModel = currentModel.internal().copy(); newModel.stringAttribute.set("XXX"); DataMerger<ExampleFactoryPermission> dataMerger = new DataMerger<>(currentModel, originalModel, newModel); MergeDiffInfo<ExampleFactoryPermission> mergeDiff= dataMerger.mergeIntoCurrent((permission)->false); Assertions.assertFalse(mergeDiff.hasNoPermissionViolation()); Assertions.assertFalse(mergeDiff.successfullyMerged()); }
public MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker) { return createMergeResult(permissionChecker).executeMerge(); }
DataMerger { public MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker) { return createMergeResult(permissionChecker).executeMerge(); } }
DataMerger { public MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker) { return createMergeResult(permissionChecker).executeMerge(); } DataMerger(R currentData, R commonData, R newData); }
DataMerger { public MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker) { return createMergeResult(permissionChecker).executeMerge(); } DataMerger(R currentData, R commonData, R newData); MergeResult<R> createMergeResult(Function<String,Boolean> permissionChecker); MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker); }
DataMerger { public MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker) { return createMergeResult(permissionChecker).executeMerge(); } DataMerger(R currentData, R commonData, R newData); MergeResult<R> createMergeResult(Function<String,Boolean> permissionChecker); MergeDiffInfo<R> mergeIntoCurrent(Function<String,Boolean> permissionChecker);  }