### Question:
CreateEdgeLogEntry implements LogEntry { @Override public void appendToLog(LogOutput dbLog) { dbLog.newEdge(edge); StreamIterator.stream(edge.properties()) .filter(property -> !propertiesToIgnore.contains(property.key())) .forEach(dbLog::newProperty); } CreateEdgeLogEntry(Edge edge);  CreateEdgeLogEntry(Edge edge, Set<String> propertiesToIgnore); @Override void appendToLog(LogOutput dbLog);  }### Answer:
@Test public void appendToLogLogsANewEdgesHasBeenCreated() { Edge edge = edge().build(); CreateEdgeLogEntry instance = new CreateEdgeLogEntry(edge); LogOutput dbLog = mock(LogOutput.class); instance.appendToLog(dbLog); verify(dbLog).newEdge(edge); }
@Test public void appendToLogLogsAPropertyIsAddedForEachPropertyOfTheEdge() { Edge edge = edge().withProperty("prop1", "value") .withProperty("prop2", "value") .withProperty("prop3", "value") .build(); CreateEdgeLogEntry instance = new CreateEdgeLogEntry(edge); LogOutput dbLog = mock(LogOutput.class); instance.appendToLog(dbLog); verify(dbLog).newProperty(argThat(likeProperty().withKey("prop1"))); verify(dbLog).newProperty(argThat(likeProperty().withKey("prop2"))); verify(dbLog).newProperty(argThat(likeProperty().withKey("prop3"))); }
@Test public void appendToLogIgnoresThePropertiesToIgnore() { LogOutput logOutput = mock(LogOutput.class); String propToIgnore = "propToIgnore"; Edge edge = edge().withProperty(propToIgnore, "value").build(); CreateEdgeLogEntry instance = new CreateEdgeLogEntry(edge, Sets.newHashSet(propToIgnore)); instance.appendToLog(logOutput); verify(logOutput, never()).newProperty(argThat(likeProperty().withKey(propToIgnore))); }