@Test public void testThatUpdatesTheCounterFromDecreaseEventFromStream() { buildWithEvent(counterDecreasedAdapter.toEntry(new CounterDecreased(CURRENT_COUNTER))); verify(journalReader, timeout(TIMEOUT).atLeastOnce()).readNext(); int result = query.counter().await(); assertEquals(CURRENT_COUNTER, result); }
@Override public Completes<Integer> counter() { return completes().with(currentCount.orElse(-1)); }
CounterQueryActor extends Actor implements CounterQuery, Scheduled<Object> { @Override public Completes<Integer> counter() { return completes().with(currentCount.orElse(-1)); } }
CounterQueryActor extends Actor implements CounterQuery, Scheduled<Object> { @Override public Completes<Integer> counter() { return completes().with(currentCount.orElse(-1)); } @SuppressWarnings("unchecked")  CounterQueryActor(JournalReader<TextEntry> streamReader, EntryAdapterProvider entryAdapterProvider); }
CounterQueryActor extends Actor implements CounterQuery, Scheduled<Object> { @Override public Completes<Integer> counter() { return completes().with(currentCount.orElse(-1)); } @SuppressWarnings("unchecked")  CounterQueryActor(JournalReader<TextEntry> streamReader, EntryAdapterProvider entryAdapterProvider); @Override Completes<Integer> counter(); @Override @SuppressWarnings("rawtypes") void intervalSignal(Scheduled<Object> scheduled, Object data); @Override void stop(); }
CounterQueryActor extends Actor implements CounterQuery, Scheduled<Object> { @Override public Completes<Integer> counter() { return completes().with(currentCount.orElse(-1)); } @SuppressWarnings("unchecked")  CounterQueryActor(JournalReader<TextEntry> streamReader, EntryAdapterProvider entryAdapterProvider); @Override Completes<Integer> counter(); @Override @SuppressWarnings("rawtypes") void intervalSignal(Scheduled<Object> scheduled, Object data); @Override void stop();  }