@Test void onOrganizationRegistrationConfirmedAfterUserWithEmailCreated_WillDeleteProjectedPendingRegistration() { var organizationRegistrationConfirmedAfterUserWithEmailCreatedEvent = new OrganizationRegistrationConfirmedAfterUserWithEmailCreatedEvent(REGISTRATION_CONFIRMATION_CODE, ORGANIZATION_ID, REGISTERING_USER_ID, CONTACT_EMAIL); pendingRegistrationsEventHandler.on(organizationRegistrationConfirmedAfterUserWithEmailCreatedEvent); verify(pendingRegistrationsRepository).deleteById(REGISTRATION_CONFIRMATION_CODE); }
@EventHandler void on(OrganizationRegistrationReceivedEvent event, @Timestamp Instant registrationReceivedTime) { LOGGER.info("Creating pending registration for organization {}", event.getOrganizationId()); pendingRegistrationsRepository.createPendingRegistration(event.getRegistrationConfirmationCode(), event.getOrganizationId(), event.getRegisteringUserId(), event.getRegisteringContactEmail(), registrationReceivedTime); }
PendingRegistrationsEventHandler implements ReplayCompletionAware { @EventHandler void on(OrganizationRegistrationReceivedEvent event, @Timestamp Instant registrationReceivedTime) { LOGGER.info("Creating pending registration for organization {}", event.getOrganizationId()); pendingRegistrationsRepository.createPendingRegistration(event.getRegistrationConfirmationCode(), event.getOrganizationId(), event.getRegisteringUserId(), event.getRegisteringContactEmail(), registrationReceivedTime); } }
PendingRegistrationsEventHandler implements ReplayCompletionAware { @EventHandler void on(OrganizationRegistrationReceivedEvent event, @Timestamp Instant registrationReceivedTime) { LOGGER.info("Creating pending registration for organization {}", event.getOrganizationId()); pendingRegistrationsRepository.createPendingRegistration(event.getRegistrationConfirmationCode(), event.getOrganizationId(), event.getRegisteringUserId(), event.getRegisteringContactEmail(), registrationReceivedTime); } PendingRegistrationsEventHandler(PendingRegistrationsRepository pendingRegistrationsRepository); }
PendingRegistrationsEventHandler implements ReplayCompletionAware { @EventHandler void on(OrganizationRegistrationReceivedEvent event, @Timestamp Instant registrationReceivedTime) { LOGGER.info("Creating pending registration for organization {}", event.getOrganizationId()); pendingRegistrationsRepository.createPendingRegistration(event.getRegistrationConfirmationCode(), event.getOrganizationId(), event.getRegisteringUserId(), event.getRegisteringContactEmail(), registrationReceivedTime); } PendingRegistrationsEventHandler(PendingRegistrationsRepository pendingRegistrationsRepository); @ResetHandler void prepareForReplay(); }
PendingRegistrationsEventHandler implements ReplayCompletionAware { @EventHandler void on(OrganizationRegistrationReceivedEvent event, @Timestamp Instant registrationReceivedTime) { LOGGER.info("Creating pending registration for organization {}", event.getOrganizationId()); pendingRegistrationsRepository.createPendingRegistration(event.getRegistrationConfirmationCode(), event.getOrganizationId(), event.getRegisteringUserId(), event.getRegisteringContactEmail(), registrationReceivedTime); } PendingRegistrationsEventHandler(PendingRegistrationsRepository pendingRegistrationsRepository); @ResetHandler void prepareForReplay();  }