@Test void registeredOrganisation_WillSendCommandAndWaitForCompletion() { var expectedCommand = new RegisterOrganizationCommand(REGISTRATION_CONFIRMATION_CODE, ORGANIZATION_ID, ORG_ADMIN_USER_ID, ORG_ADMIN_EMAIL_ADDRESS_1, ORG_ADMIN_ENCODED_PASSWORD, ORGANIZATION_NAME, ORGANIZATION_STREET_1, ORGANIZATION_CITY_1, ORGANIZATION_STATE_1, ORGANIZATION_COUNTRY_1, ORGANIZATION_POSTAL_CODE_1, ORGANIZATION_WEBSITE_URL_1, ORGANIZATION_CONTACT_NAME_1, ORGANIZATION_PHONE_NUMBER_1); when(randomFieldsGenerator.genRandomUUID()).thenReturn(REGISTRATION_CONFIRMATION_CODE); when(commandGateway.sendAndWait(expectedCommand)).thenReturn(ORGANIZATION_ID); when(passwordEncoder.encode(ORG_ADMIN_RAW_PASSWORD)).thenReturn(ORG_ADMIN_ENCODED_PASSWORD); defaultPendingRegistrationsService.registerOrganization(ORGANIZATION_ID, ORG_ADMIN_USER_ID, ORGANIZATION_NAME, ORGANIZATION_STREET_1, ORGANIZATION_CITY_1, ORGANIZATION_STATE_1, ORGANIZATION_COUNTRY_1, ORGANIZATION_POSTAL_CODE_1, ORGANIZATION_WEBSITE_URL_1, ORGANIZATION_CONTACT_NAME_1, ORGANIZATION_PHONE_NUMBER_1, ORG_ADMIN_EMAIL_ADDRESS_1, ORG_ADMIN_RAW_PASSWORD); verify(commandGateway).sendAndWait(expectedCommand); }
@Override public void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city, String state, String country, String postalCode, String websiteUrl, String contactName, String phoneNumber, String emailAddress, String contactRawPassword) { commandGateway.sendAndWait(new RegisterOrganizationCommand(randomFieldsGenerator.genRandomUUID(), organizationId, userId, emailAddress, encodePasswordIfNotBlank(contactRawPassword), organizationName, street, city, state, country, postalCode, websiteUrl, contactName, phoneNumber)); }
DefaultPendingRegistrationsService implements PendingRegistrationsService { @Override public void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city, String state, String country, String postalCode, String websiteUrl, String contactName, String phoneNumber, String emailAddress, String contactRawPassword) { commandGateway.sendAndWait(new RegisterOrganizationCommand(randomFieldsGenerator.genRandomUUID(), organizationId, userId, emailAddress, encodePasswordIfNotBlank(contactRawPassword), organizationName, street, city, state, country, postalCode, websiteUrl, contactName, phoneNumber)); } }
DefaultPendingRegistrationsService implements PendingRegistrationsService { @Override public void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city, String state, String country, String postalCode, String websiteUrl, String contactName, String phoneNumber, String emailAddress, String contactRawPassword) { commandGateway.sendAndWait(new RegisterOrganizationCommand(randomFieldsGenerator.genRandomUUID(), organizationId, userId, emailAddress, encodePasswordIfNotBlank(contactRawPassword), organizationName, street, city, state, country, postalCode, websiteUrl, contactName, phoneNumber)); } DefaultPendingRegistrationsService(RandomFieldsGenerator randomFieldsGenerator,
                                              HazelcastCommandGateway commandGateway,
                                              PasswordEncoder passwordEncoder); }
DefaultPendingRegistrationsService implements PendingRegistrationsService { @Override public void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city, String state, String country, String postalCode, String websiteUrl, String contactName, String phoneNumber, String emailAddress, String contactRawPassword) { commandGateway.sendAndWait(new RegisterOrganizationCommand(randomFieldsGenerator.genRandomUUID(), organizationId, userId, emailAddress, encodePasswordIfNotBlank(contactRawPassword), organizationName, street, city, state, country, postalCode, websiteUrl, contactName, phoneNumber)); } DefaultPendingRegistrationsService(RandomFieldsGenerator randomFieldsGenerator,
                                              HazelcastCommandGateway commandGateway,
                                              PasswordEncoder passwordEncoder); @Override void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city,
                                     String state, String country, String postalCode, String websiteUrl, String contactName,
                                     String phoneNumber, String emailAddress, String contactRawPassword); @Override void confirmOrganizationRegistrationEmail(UUID organizationId, UUID confirmationCode); }
DefaultPendingRegistrationsService implements PendingRegistrationsService { @Override public void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city, String state, String country, String postalCode, String websiteUrl, String contactName, String phoneNumber, String emailAddress, String contactRawPassword) { commandGateway.sendAndWait(new RegisterOrganizationCommand(randomFieldsGenerator.genRandomUUID(), organizationId, userId, emailAddress, encodePasswordIfNotBlank(contactRawPassword), organizationName, street, city, state, country, postalCode, websiteUrl, contactName, phoneNumber)); } DefaultPendingRegistrationsService(RandomFieldsGenerator randomFieldsGenerator,
                                              HazelcastCommandGateway commandGateway,
                                              PasswordEncoder passwordEncoder); @Override void registerOrganization(UUID organizationId, UUID userId, String organizationName, String street, String city,
                                     String state, String country, String postalCode, String websiteUrl, String contactName,
                                     String phoneNumber, String emailAddress, String contactRawPassword); @Override void confirmOrganizationRegistrationEmail(UUID organizationId, UUID confirmationCode);  }