@Test void onClaimed() { final RequestClaimedEvent claimedEvent = RequestClaimedEvent.builder() .claimDto(ClaimDtoMother.aClaimDto().build()) .timestamp(LocalDateTime.now()) .blockchainEventId(24L) .requestDto(RequestDtoMother.fundRequestArea51()) .solver("sbsgdb") .build(); final RequestClaimedNotificationDto expected = RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build(); eventHandler.onClaimed(claimedEvent); verify(eventPublisher).publishEvent(refEq(expected, "uuid")); }
@TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build()); }
PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build()); } }
PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build()); } PublishRequestClaimedNotificationHandler(final ApplicationEventPublisher eventPublisher); }
PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build()); } PublishRequestClaimedNotificationHandler(final ApplicationEventPublisher eventPublisher); @TransactionalEventListener void onClaimed(final RequestClaimedEvent claimedEvent); }
PublishRequestClaimedNotificationHandler { @TransactionalEventListener public void onClaimed(final RequestClaimedEvent claimedEvent) { eventPublisher.publishEvent(RequestClaimedNotificationDto.builder() .blockchainEventId(claimedEvent.getBlockchainEventId()) .date(claimedEvent.getTimestamp()) .requestId(claimedEvent.getRequestDto().getId()) .claimId(claimedEvent.getClaimDto().getId()) .build()); } PublishRequestClaimedNotificationHandler(final ApplicationEventPublisher eventPublisher); @TransactionalEventListener void onClaimed(final RequestClaimedEvent claimedEvent);  }