Beispiel #1
0
 @Test(expected = ValidationException.class)
 public void updateUserWithInvalidEmailAddress() {
   ExternalUser user = createUserWithRandomUserName(Role.authenticated);
   UpdateUserRequest request = new UpdateUserRequest();
   request.setEmailAddress("NotAValidEmailAddress");
   userService.saveUser(user.getId().toString(), request);
 }
Beispiel #2
0
 @Test
 public void updateUser() {
   ExternalUser user = createUserWithRandomUserName(Role.authenticated);
   UpdateUserRequest request = new UpdateUserRequest();
   request.setFirstName("foo");
   request.setLastName("bar");
   request.setEmailAddress("*****@*****.**");
   userService.saveUser(user.getId(), request);
   User loadedUser = userRepository.findByUuid(user.getId());
   assertThat(loadedUser.getFirstName(), is("foo"));
   assertThat(loadedUser.getLastName(), is("bar"));
   assertThat(loadedUser.getEmailAddress(), is("*****@*****.**"));
 }