@Test public void appendToLogAddsANewPropertyLineForEachPropertyThatDoesNotExistInThePreviousVersion() { Vertex oldVersion = vertex().withId("id").withProperty("oldProp", "oldValue").withProperty("rev", 1).build(); String newProp = "newProp"; String newProp2 = "newProp2"; Vertex vertex = vertex().withId("id") .withProperty(newProp, "value") .withProperty(newProp2, "value") .withProperty("oldProp", "oldValue") .withProperty("rev", 2) .build(); LogOutput dbLog = mock(LogOutput.class); UpdateVertexLogEntry instance = new UpdateVertexLogEntry(vertex, oldVersion); instance.appendToLog(dbLog); verify(dbLog).updateVertex(vertex); verify(dbLog).newProperty(argThat(likeProperty().withKey(newProp))); verify(dbLog).newProperty(argThat(likeProperty().withKey(newProp2))); verify(dbLog).updateProperty(argThat(likeProperty().withKey("rev"))); verifyNoMoreInteractions(dbLog); }
@Override public void appendToLog(LogOutput dbLog) { dbLog.updateVertex(vertex); propertyUpdater.updateProperties(dbLog); }
UpdateVertexLogEntry implements LogEntry { @Override public void appendToLog(LogOutput dbLog) { dbLog.updateVertex(vertex); propertyUpdater.updateProperties(dbLog); } }
UpdateVertexLogEntry implements LogEntry { @Override public void appendToLog(LogOutput dbLog) { dbLog.updateVertex(vertex); propertyUpdater.updateProperties(dbLog); } UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion);   UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion, Set<String> propertiesToIgnore); }
UpdateVertexLogEntry implements LogEntry { @Override public void appendToLog(LogOutput dbLog) { dbLog.updateVertex(vertex); propertyUpdater.updateProperties(dbLog); } UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion);   UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion, Set<String> propertiesToIgnore); @Override void appendToLog(LogOutput dbLog); }
UpdateVertexLogEntry implements LogEntry { @Override public void appendToLog(LogOutput dbLog) { dbLog.updateVertex(vertex); propertyUpdater.updateProperties(dbLog); } UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion);   UpdateVertexLogEntry(Vertex vertex, Vertex previousVersion, Set<String> propertiesToIgnore); @Override void appendToLog(LogOutput dbLog);  }