ExternalIdentityConflictHandler implements ThreeWayConflictHandler { @NotNull @Override public Resolution addExistingProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState theirs) { if (ExternalIdentityConstants.REP_LAST_SYNCED.equals(ours.getName())) { return merge(parent, ours, theirs); } return Resolution.IGNORED; }  @NotNull @Override Resolution addExistingProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState theirs); @NotNull @Override Resolution changeChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState theirs,
                                            @NotNull PropertyState base); @Override @NotNull Resolution changeDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState ours, @NotNull PropertyState base); @Override @NotNull Resolution deleteDeletedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState base); @Override @NotNull Resolution deleteChangedProperty(@NotNull NodeBuilder parent, @NotNull PropertyState theirs,
            @NotNull PropertyState base); @Override @NotNull Resolution addExistingNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours,
            @NotNull NodeState theirs); @Override @NotNull Resolution changeDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState ours,
            @NotNull NodeState base); @Override @NotNull Resolution deleteChangedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState theirs,
            @NotNull NodeState base); @Override @NotNull Resolution deleteDeletedNode(@NotNull NodeBuilder parent, @NotNull String name, @NotNull NodeState base);  }
@Test public void testAddExistingProperty() { assertSame(ThreeWayConflictHandler.Resolution.IGNORED, handler.addExistingProperty(mock(NodeBuilder.class), mock(PropertyState.class), mock(PropertyState.class))); }
@Test public void testAddExistingPropertyRepLastSynced() { Calendar cal = Calendar.getInstance(); String calStr = ISO8601.format(cal); cal.set(Calendar.YEAR, 2000); String calStr2 = ISO8601.format(cal); PropertyState ours = when(mock(PropertyState.class).getName()).thenReturn(REP_LAST_SYNCED).getMock(); when(ours.getValue(Type.DATE)).thenReturn(calStr); PropertyState theirs = when(mock(PropertyState.class).getValue(Type.DATE)).thenReturn(calStr2).getMock(); assertSame(ThreeWayConflictHandler.Resolution.MERGED, handler.addExistingProperty(mock(NodeBuilder.class), ours, theirs)); }