@Test public void testHandleOffsetReceived() throws Exception { OffsetReceivedFeeCommand command = new OffsetReceivedFeeCommand(receivedFeeId, offsetId, tradeTime); receivedFixture.given(new ReceivedFeeCreatedEvent( receivedFeeId, FeeStatus.PENDING, sellCommissionAmount, FeeType.RECEIVE_MONEY, tradeTime, dueDate, portfolioId.toString(), userId.toString(), BusinessType.TRADE_EXECUTED, orderTransactionId.toString(), receivedSource)) .when(command) .expectEvents(new ReceivedFeeOffsetedEvent(receivedFeeId, offsetId, tradeTime)); }
@CommandHandler public void handleOffsetReceived(OffsetReceivedFeeCommand command) { ReceivedFee fee = receivedFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }
ReceivedPaidFeeCommandHandler { @CommandHandler public void handleOffsetReceived(OffsetReceivedFeeCommand command) { ReceivedFee fee = receivedFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); } }
ReceivedPaidFeeCommandHandler { @CommandHandler public void handleOffsetReceived(OffsetReceivedFeeCommand command) { ReceivedFee fee = receivedFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  }
ReceivedPaidFeeCommandHandler { @CommandHandler public void handleOffsetReceived(OffsetReceivedFeeCommand command) { ReceivedFee fee = receivedFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  @CommandHandler void handleCreateReceived(CreateReceivedFeeCommand command); @CommandHandler void handleConfirmReceived(ConfirmReceivedFeeCommand command); @CommandHandler void handleOffsetReceived(OffsetReceivedFeeCommand command); @CommandHandler void handleCancelReceived(CancelReceivedFeeCommand command); @CommandHandler void handleCreatePaid(CreatePaidFeeCommand command); @CommandHandler void handleConfirmPaid(ConfirmPaidFeeCommand command); @CommandHandler void handleOffsetPaid(OffsetPaidFeeCommand command); @CommandHandler void handleCancelPaid(CancelPaidFeeCommand command); @Resource(name = "receivedFeeRepository") void setReceivedFeeRepository(Repository<ReceivedFee> receivedFeeRepository); @Resource(name = "paidFeeRepository") void setPaidFeeRepository(Repository<PaidFee> paidFeeRepository); }
ReceivedPaidFeeCommandHandler { @CommandHandler public void handleOffsetReceived(OffsetReceivedFeeCommand command) { ReceivedFee fee = receivedFeeRepository.load(command.getFeeId()); fee.offset(command.getOffsetId(), command.getOffsetedDate()); }  @CommandHandler void handleCreateReceived(CreateReceivedFeeCommand command); @CommandHandler void handleConfirmReceived(ConfirmReceivedFeeCommand command); @CommandHandler void handleOffsetReceived(OffsetReceivedFeeCommand command); @CommandHandler void handleCancelReceived(CancelReceivedFeeCommand command); @CommandHandler void handleCreatePaid(CreatePaidFeeCommand command); @CommandHandler void handleConfirmPaid(ConfirmPaidFeeCommand command); @CommandHandler void handleOffsetPaid(OffsetPaidFeeCommand command); @CommandHandler void handleCancelPaid(CancelPaidFeeCommand command); @Resource(name = "receivedFeeRepository") void setReceivedFeeRepository(Repository<ReceivedFee> receivedFeeRepository); @Resource(name = "paidFeeRepository") void setPaidFeeRepository(Repository<PaidFee> paidFeeRepository);  }