MessageDispatcher { public void reset() { stats = new MessageProcessingStats(); } MessageDispatcher(final SQSProxy sqsProxy, final MessageProcessorProxy messageProcessorProxy); void dispatch(final List<Message> messages); void reset(); int getEstimatedCapacity(Instant cutoff);  }
@Test public void reset() throws Exception { dispatcher = new MessageDispatcher(sqsProxy, messageProcessorProxy); mockProcessorResults(messageResult("1", SQSMessageResult.Status.SUCCESS)); dispatcher.dispatch(Lists.newArrayList(mockMessage("1"))); assertThat(dispatcher.getEstimatedCapacity(NOW), is(not(Integer.MAX_VALUE))); dispatcher.reset(); assertThat(dispatcher.getEstimatedCapacity(NOW), is(Integer.MAX_VALUE)); }