@Test public void testOnBuyTransactionCancelledEventCancelsTransactionView() { testSubject.on(new BuyTransactionCancelledEvent(transactionId, DEFAULT_TOTAL_ITEMS, DEFAULT_TOTAL_ITEMS)); verify(transactionViewRepository).save(transactionViewCaptor.capture()); TransactionView result = transactionViewCaptor.getValue(); assertEquals(TransactionState.CANCELLED, result.getState()); }
@EventHandler public void on(BuyTransactionStartedEvent event) { startTransaction(event, TransactionType.BUY); }
TransactionEventHandler { @EventHandler public void on(BuyTransactionStartedEvent event) { startTransaction(event, TransactionType.BUY); } }
TransactionEventHandler { @EventHandler public void on(BuyTransactionStartedEvent event) { startTransaction(event, TransactionType.BUY); } TransactionEventHandler(OrderBookViewRepository orderBookViewRepository,
                                   TransactionViewRepository transactionViewRepository); }
TransactionEventHandler { @EventHandler public void on(BuyTransactionStartedEvent event) { startTransaction(event, TransactionType.BUY); } TransactionEventHandler(OrderBookViewRepository orderBookViewRepository,
                                   TransactionViewRepository transactionViewRepository); @EventHandler void on(BuyTransactionStartedEvent event); @EventHandler void on(SellTransactionStartedEvent event); @EventHandler void on(BuyTransactionCancelledEvent event); @EventHandler void on(SellTransactionCancelledEvent event); @EventHandler void on(BuyTransactionConfirmedEvent event); @EventHandler void on(SellTransactionConfirmedEvent event); @EventHandler void on(BuyTransactionExecutedEvent event); @EventHandler void on(SellTransactionExecutedEvent event); @EventHandler void on(BuyTransactionPartiallyExecutedEvent event); @EventHandler void on(SellTransactionPartiallyExecutedEvent event); @QueryHandler TransactionView find(TransactionByIdQuery query); @QueryHandler List<TransactionView> find(TransactionsByPortfolioIdQuery query); }
TransactionEventHandler { @EventHandler public void on(BuyTransactionStartedEvent event) { startTransaction(event, TransactionType.BUY); } TransactionEventHandler(OrderBookViewRepository orderBookViewRepository,
                                   TransactionViewRepository transactionViewRepository); @EventHandler void on(BuyTransactionStartedEvent event); @EventHandler void on(SellTransactionStartedEvent event); @EventHandler void on(BuyTransactionCancelledEvent event); @EventHandler void on(SellTransactionCancelledEvent event); @EventHandler void on(BuyTransactionConfirmedEvent event); @EventHandler void on(SellTransactionConfirmedEvent event); @EventHandler void on(BuyTransactionExecutedEvent event); @EventHandler void on(SellTransactionExecutedEvent event); @EventHandler void on(BuyTransactionPartiallyExecutedEvent event); @EventHandler void on(SellTransactionPartiallyExecutedEvent event); @QueryHandler TransactionView find(TransactionByIdQuery query); @QueryHandler List<TransactionView> find(TransactionsByPortfolioIdQuery query);  }