@Test public void testHandleCancelAccountPayable() throws Exception { CancelAccountPayableFeeCommand command = new CancelAccountPayableFeeCommand(payableFeeId, CancelledReason.OFFSET_ERROR, tradeTime); payableFixture.given( new AccountPayableFeeCreatedEvent( payableFeeId, FeeStatus.PENDING, sellCommissionAmount, FeeType.RECEIVE_COIN, tradeTime, dueDate, portfolioId.toString(), userId.toString(), BusinessType.TRADE_EXECUTED, orderTransactionId.toString())) .when(command) .expectEvents( new AccountPayableFeeCancelledEvent( payableFeeId, CancelledReason.OFFSET_ERROR, tradeTime)); }
@CommandHandler public void handleCancelAccountPayable(CancelAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.cancel(command.getCancelledReason(), command.getCancelledDate()); }
ReceivablePayableCommandHandler { @CommandHandler public void handleCancelAccountPayable(CancelAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.cancel(command.getCancelledReason(), command.getCancelledDate()); } }
ReceivablePayableCommandHandler { @CommandHandler public void handleCancelAccountPayable(CancelAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.cancel(command.getCancelledReason(), command.getCancelledDate()); }  }
ReceivablePayableCommandHandler { @CommandHandler public void handleCancelAccountPayable(CancelAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.cancel(command.getCancelledReason(), command.getCancelledDate()); }  @CommandHandler void handleCreateAccountReceivable(CreateAccountReceivableFeeCommand command); @CommandHandler void handleConfirmAccountReceivable(ConfirmAccountReceivableFeeCommand command); @CommandHandler void handleOffsetAccountReceivable(OffsetAccountReceivableFeeCommand command); @CommandHandler void handleCancelAccountReceivable(CancelAccountReceivableFeeCommand command); @CommandHandler void handleCreateAccountPayable(CreateAccountPayableFeeCommand command); @CommandHandler void handleConfirmAccountPayable(ConfirmAccountPayableFeeCommand command); @CommandHandler void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command); @CommandHandler void handleCancelAccountPayable(CancelAccountPayableFeeCommand command); @Resource(name = "accountReceivableFeeRepository") void setAccountReceivableFeeRepository(Repository<AccountReceivableFee> accountReceivableFeeRepository); @Resource(name = "accountReceivableFeeRepository") void setAccountPayableFeeRepository(Repository<AccountPayableFee> accountPayableFeeRepository); }
ReceivablePayableCommandHandler { @CommandHandler public void handleCancelAccountPayable(CancelAccountPayableFeeCommand command) { AccountPayableFee fee = accountPayableFeeRepository.load(command.getFeeId()); fee.cancel(command.getCancelledReason(), command.getCancelledDate()); }  @CommandHandler void handleCreateAccountReceivable(CreateAccountReceivableFeeCommand command); @CommandHandler void handleConfirmAccountReceivable(ConfirmAccountReceivableFeeCommand command); @CommandHandler void handleOffsetAccountReceivable(OffsetAccountReceivableFeeCommand command); @CommandHandler void handleCancelAccountReceivable(CancelAccountReceivableFeeCommand command); @CommandHandler void handleCreateAccountPayable(CreateAccountPayableFeeCommand command); @CommandHandler void handleConfirmAccountPayable(ConfirmAccountPayableFeeCommand command); @CommandHandler void handleOffsetAccountPayable(OffsetAccountPayableFeeCommand command); @CommandHandler void handleCancelAccountPayable(CancelAccountPayableFeeCommand command); @Resource(name = "accountReceivableFeeRepository") void setAccountReceivableFeeRepository(Repository<AccountReceivableFee> accountReceivableFeeRepository); @Resource(name = "accountReceivableFeeRepository") void setAccountPayableFeeRepository(Repository<AccountPayableFee> accountPayableFeeRepository);  }