@Test
public void testStatsLogging()
    throws JsonSyntaxException, UnsupportedEncodingException, IOException, OperationException {

  DummyOperationFactory mutatorFactory = new DummyOperationFactory();
  OperationProcessor processor = new OperationProcessor(mutatorFactory);
  /*
   * Mock the Stat object
   */
  Stat runtimeStat = mock(Stat.class);
  Stat successStat = mock(Stat.class);
  Stat errorStat = mock(Stat.class);
  processor.setRuntimeStat(runtimeStat);
  processor.setSuccessCountStat(successStat);
  processor.setErrorCountStat(errorStat);
  InternalEvent ievent = new InternalEvent("foo", null, 1);
  ievent.setEventObj(new DummyDeserializerHelper.DummyStringEvent("test"));
  Stream<InternalEvent> stream = processor.perform(Stream.of(ievent));
  List<InternalEvent> output = stream.collect(Collectors.toList());
  /*
   * Verify start, stop, increment success count, and never increment error count.
   */
  verify(runtimeStat, times(1)).start();
  verify(runtimeStat, times(1)).stop();
  verify(successStat, times(1)).increment();
  verify(errorStat, never()).increment();
  /*
   * Verify contents of output stream
   */
  assertEquals(1, output.size());
}