@Test public void shouldReadSummarisedObservation() { final ErrorConsumer consumer = mock(ErrorConsumer.class); final long timestampOne = 7; final long timestampTwo = 10; final RuntimeException error = new RuntimeException("Test Error"); final StringWriter stringWriter = new StringWriter(); error.printStackTrace(new PrintWriter(stringWriter)); final String errorAsString = stringWriter.toString(); when(clock.time()).thenReturn(timestampOne).thenReturn(timestampTwo); log.record(error); log.record(error); assertThat(ErrorLogReader.read(buffer, consumer), is(1)); verify(consumer).accept(eq(2), eq(timestampOne), eq(timestampTwo), eq(errorAsString)); }
public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); } }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  static boolean hasErrors(final AtomicBuffer buffer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer, final long sinceTimestamp); }
ErrorLogReader { public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer) { return read(buffer, consumer, 0); }  static boolean hasErrors(final AtomicBuffer buffer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer); static int read(final AtomicBuffer buffer, final ErrorConsumer consumer, final long sinceTimestamp);  }