@Test public void handleIncomingRequestCountZero() throws Exception { underTest.handleIncomingEvent(new Request(0L)); assertThat(underTest.getRequested(), is(0L)); }
@VisibleForTesting void handleIncomingEvent(Event event) { log.debug("Received Event: {}", event); switch (event.getType()) { case REQUEST: handleRequest((Request) event); break; case CANCEL: requested = 0L; break; case COMMIT: handleCommit((Commit) event); break; default: throw new IllegalStateException("Unexpected event type: " + event); } }
OfframpServiceV2 implements OfframpService { @VisibleForTesting void handleIncomingEvent(Event event) { log.debug("Received Event: {}", event); switch (event.getType()) { case REQUEST: handleRequest((Request) event); break; case CANCEL: requested = 0L; break; case COMMIT: handleCommit((Commit) event); break; default: throw new IllegalStateException("Unexpected event type: " + event); } } }
OfframpServiceV2 implements OfframpService { @VisibleForTesting void handleIncomingEvent(Event event) { log.debug("Received Event: {}", event); switch (event.getType()) { case REQUEST: handleRequest((Request) event); break; case CANCEL: requested = 0L; break; case COMMIT: handleCommit((Commit) event); break; default: throw new IllegalStateException("Unexpected event type: " + event); } }  }
OfframpServiceV2 implements OfframpService { @VisibleForTesting void handleIncomingEvent(Event event) { log.debug("Received Event: {}", event); switch (event.getType()) { case REQUEST: handleRequest((Request) event); break; case CANCEL: requested = 0L; break; case COMMIT: handleCommit((Commit) event); break; default: throw new IllegalStateException("Unexpected event type: " + event); } }  @Override void run(); @Override void close(); @Override void onEvent(String event); }
OfframpServiceV2 implements OfframpService { @VisibleForTesting void handleIncomingEvent(Event event) { log.debug("Received Event: {}", event); switch (event.getType()) { case REQUEST: handleRequest((Request) event); break; case CANCEL: requested = 0L; break; case COMMIT: handleCommit((Commit) event); break; default: throw new IllegalStateException("Unexpected event type: " + event); } }  @Override void run(); @Override void close(); @Override void onEvent(String event);  }