RepMembersConflictHandler implements ThreeWayConflictHandler { @Override @NotNull public Resolution changeDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState base) { if (isRepMembersProperty(ours)) { return Resolution.THEIRS; } else { return Resolution.IGNORED; } }  @NotNull @Override Resolution addExistingProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours,
            @NotNull PropertyState theirs); @Override @NotNull Resolution changeDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours,
            @NotNull PropertyState base); @NotNull @Override Resolution changeChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours,
            @NotNull PropertyState theirs, @NotNull PropertyState base); @NotNull @Override Resolution deleteDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState base); @NotNull @Override Resolution deleteChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState theirs,
            @NotNull PropertyState base); @NotNull @Override Resolution addExistingNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours,
            @NotNull NodeState theirs); @NotNull @Override Resolution changeDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours,
            @NotNull NodeState base); @NotNull @Override Resolution deleteChangedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState theirs,
            @NotNull NodeState base); @NotNull @Override Resolution deleteDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState base);  }
@Test public void changeDeletedProperty() throws Exception { add(root, users[0].getID(), users[1].getID()); Root ours = login(getAdminCredentials()).getLatestRoot(); Root theirs = login(getAdminCredentials()).getLatestRoot(); wipeGroup(theirs); add(ours, users[2].getID()); root.refresh(); assertFalse(group.isDeclaredMember(users[0])); assertFalse(group.isDeclaredMember(users[1])); }
@Test public void testChangeDeletedPropertyRepMembers() { RepMembersConflictHandler handler = new RepMembersConflictHandler(); PropertyState ours = PropertyStates.createProperty(UserConstants.REP_MEMBERS, "value"); assertSame(ThreeWayConflictHandler.Resolution.THEIRS, handler.changeDeletedProperty(mock(NodeBuilder.class), ours, mock(PropertyState.class))); }
@Test public void testChangeDeletedPropertyOther() { RepMembersConflictHandler handler = new RepMembersConflictHandler(); PropertyState ours = PropertyStates.createProperty("any", "value"); assertSame(ThreeWayConflictHandler.Resolution.IGNORED, handler.changeDeletedProperty(mock(NodeBuilder.class), ours, mock(PropertyState.class))); }