@Test public void testHandleCreateOffset() throws Exception { CreateOffsetCommand command = new CreateOffsetCommand(offsetId, OffsetType.RECEIVED_AR, portfolioId.toString(), ImmutableList.of(new FeeItem(receivedFeeId.toString(), FeeItemType.AR, offsetAmount)), ImmutableList.of( new FeeItem(accountReceivableFeeId1.toString(), FeeItemType.RECEIVED, receivedAmount1), new FeeItem(accountReceivableFeeId2.toString(), FeeItemType.RECEIVED, receivedAmount2)), offsetAmount, tradeTime); fixture.given() .when(command) .expectEvents(new OffsetCreatedEvent(offsetId, OffsetType.RECEIVED_AR, portfolioId.toString(), ImmutableList.of(new FeeItem(receivedFeeId.toString(), FeeItemType.AR, offsetAmount)), ImmutableList.of( new FeeItem(accountReceivableFeeId1.toString(), FeeItemType.RECEIVED, receivedAmount1), new FeeItem(accountReceivableFeeId2.toString(), FeeItemType.RECEIVED, receivedAmount2)), offsetAmount, tradeTime)); }
@CommandHandler public void handleCreateOffset(CreateOffsetCommand command) { offsetRepository.add( new Offset(command.getOffsetId(), command.getOffsetType(), command.getAccountId(), command.getArapList(), command.getReceivedPaidList(), command.getOffsetAmount(), command.getStartedDate())); }
OffsetCommandHandler { @CommandHandler public void handleCreateOffset(CreateOffsetCommand command) { offsetRepository.add( new Offset(command.getOffsetId(), command.getOffsetType(), command.getAccountId(), command.getArapList(), command.getReceivedPaidList(), command.getOffsetAmount(), command.getStartedDate())); } }
OffsetCommandHandler { @CommandHandler public void handleCreateOffset(CreateOffsetCommand command) { offsetRepository.add( new Offset(command.getOffsetId(), command.getOffsetType(), command.getAccountId(), command.getArapList(), command.getReceivedPaidList(), command.getOffsetAmount(), command.getStartedDate())); }  }
OffsetCommandHandler { @CommandHandler public void handleCreateOffset(CreateOffsetCommand command) { offsetRepository.add( new Offset(command.getOffsetId(), command.getOffsetType(), command.getAccountId(), command.getArapList(), command.getReceivedPaidList(), command.getOffsetAmount(), command.getStartedDate())); }  @CommandHandler void handleCreateOffset(CreateOffsetCommand command); @CommandHandler void handleOffsetFees(OffsetFeesCommand command); @CommandHandler void handleCancelOffset(CancelOffsetCommand command); @Resource(name = "offsetRepository") void setOffsetRepository(Repository<Offset> offsetRepository); }
OffsetCommandHandler { @CommandHandler public void handleCreateOffset(CreateOffsetCommand command) { offsetRepository.add( new Offset(command.getOffsetId(), command.getOffsetType(), command.getAccountId(), command.getArapList(), command.getReceivedPaidList(), command.getOffsetAmount(), command.getStartedDate())); }  @CommandHandler void handleCreateOffset(CreateOffsetCommand command); @CommandHandler void handleOffsetFees(OffsetFeesCommand command); @CommandHandler void handleCancelOffset(CancelOffsetCommand command); @Resource(name = "offsetRepository") void setOffsetRepository(Repository<Offset> offsetRepository);  }