@Test void updateUserDetails_WillSendCommandAndWaitForCompletion() { when(passwordEncoder.encode("password-change")).thenReturn("encoded-password-change"); defaultUsersService.updateUser(ADMIN_ID, USER_ID, "email-change", "display-name-change", "password-change"); verify(commandGateway).sendAndWait(new UpdateUserDetailsCommand(USER_ID, "email-change", "display-name-change", "encoded-password-change", ADMIN_ID)); }
@Override public void updateUser(UUID requestingUserId, UUID userId, String emailChange, String displayNameChange, String passwordChange) { commandGateway.sendAndWait(new UpdateUserDetailsCommand(userId, emailChange, displayNameChange, encodePasswordIfNotBlank(passwordChange), requestingUserId)); }
DefaultUsersService implements UsersService { @Override public void updateUser(UUID requestingUserId, UUID userId, String emailChange, String displayNameChange, String passwordChange) { commandGateway.sendAndWait(new UpdateUserDetailsCommand(userId, emailChange, displayNameChange, encodePasswordIfNotBlank(passwordChange), requestingUserId)); } }
DefaultUsersService implements UsersService { @Override public void updateUser(UUID requestingUserId, UUID userId, String emailChange, String displayNameChange, String passwordChange) { commandGateway.sendAndWait(new UpdateUserDetailsCommand(userId, emailChange, displayNameChange, encodePasswordIfNotBlank(passwordChange), requestingUserId)); } DefaultUsersService(HazelcastCommandGateway commandGateway,
                               RandomFieldsGenerator randomFieldsGenerator,
                               PasswordEncoder passwordEncoder); }
DefaultUsersService implements UsersService { @Override public void updateUser(UUID requestingUserId, UUID userId, String emailChange, String displayNameChange, String passwordChange) { commandGateway.sendAndWait(new UpdateUserDetailsCommand(userId, emailChange, displayNameChange, encodePasswordIfNotBlank(passwordChange), requestingUserId)); } DefaultUsersService(HazelcastCommandGateway commandGateway,
                               RandomFieldsGenerator randomFieldsGenerator,
                               PasswordEncoder passwordEncoder); @Override void updateUser(UUID requestingUserId, UUID userId, String emailChange,
                           String displayNameChange, String passwordChange); @Override UUID createUser(UUID requestingUserId, UUID organizationId, String username, String displayName, String rawPassword); @Override void storeProfilePhoto(UUID requestingUserId, UUID profilePhotoFileId); }
DefaultUsersService implements UsersService { @Override public void updateUser(UUID requestingUserId, UUID userId, String emailChange, String displayNameChange, String passwordChange) { commandGateway.sendAndWait(new UpdateUserDetailsCommand(userId, emailChange, displayNameChange, encodePasswordIfNotBlank(passwordChange), requestingUserId)); } DefaultUsersService(HazelcastCommandGateway commandGateway,
                               RandomFieldsGenerator randomFieldsGenerator,
                               PasswordEncoder passwordEncoder); @Override void updateUser(UUID requestingUserId, UUID userId, String emailChange,
                           String displayNameChange, String passwordChange); @Override UUID createUser(UUID requestingUserId, UUID organizationId, String username, String displayName, String rawPassword); @Override void storeProfilePhoto(UUID requestingUserId, UUID profilePhotoFileId);  }