@Test public void returnStatisticsForDefaultFormatting() throws Exception { ResultSummary resultSummary = mock(ResultSummary.class); SummaryCounters summaryCounters = mock(SummaryCounters.class); when(resultSummary.counters()).thenReturn(summaryCounters); when(summaryCounters.labelsAdded()).thenReturn(1); when(summaryCounters.nodesCreated()).thenReturn(10); String actual = new StatisticsCollector(Format.VERBOSE).collect(resultSummary); assertThat(actual, is("Added 10 nodes, Added 1 labels")); }
public String collect(@Nonnull ResultSummary summary) { if (Format.VERBOSE == format) { return collectStatistics(summary); } else { return ""; } }
StatisticsCollector { public String collect(@Nonnull ResultSummary summary) { if (Format.VERBOSE == format) { return collectStatistics(summary); } else { return ""; } } }
StatisticsCollector { public String collect(@Nonnull ResultSummary summary) { if (Format.VERBOSE == format) { return collectStatistics(summary); } else { return ""; } } StatisticsCollector(@Nonnull Format format); }
StatisticsCollector { public String collect(@Nonnull ResultSummary summary) { if (Format.VERBOSE == format) { return collectStatistics(summary); } else { return ""; } } StatisticsCollector(@Nonnull Format format); String collect(@Nonnull ResultSummary summary); }
StatisticsCollector { public String collect(@Nonnull ResultSummary summary) { if (Format.VERBOSE == format) { return collectStatistics(summary); } else { return ""; } } StatisticsCollector(@Nonnull Format format); String collect(@Nonnull ResultSummary summary);  }