Example #1
0
 @Test
 public void updateUserIT() {
   final String newEmailAddress = "*****@*****.**";
   final String changedLastName = "Darko";
   final String userName = "******";
   final ContactDTO contactDTO =
       createContactDTO("Marcel", "Becker", "56076", "Koblenz", "Am Kratzkopfer Hof 1");
   final UserDTO userDTO = CreateUserDTO(userName, "12345", "*****@*****.**", contactDTO);
   final UserDTO response = userServiceBean.addUser(userDTO);
   Assert.assertNotNull(response);
   final UserDTO gotUserDTO = userServiceBean.getUserByUserName(userName);
   Assert.assertNotNull(gotUserDTO);
   gotUserDTO.setEmailAddress(newEmailAddress);
   gotUserDTO.getContactDTO().setLastName(changedLastName);
   userServiceBean.updateUser(gotUserDTO);
   final UserDTO changedUser = userServiceBean.getUserByUserName(userName);
   Assert.assertNotNull(changedUser);
   Assert.assertEquals(newEmailAddress, changedUser.getEmailAddress());
   Assert.assertEquals(changedLastName, changedUser.getContactDTO().getLastName());
 }
Example #2
0
 @Test
 public void getUserByUserNameIT() {
   final String userName = "******";
   final ContactDTO contactDTO =
       createContactDTO("Marcel", "Becker", "56076", "Koblenz", "Am Kratzkopfer Hof 1");
   final UserDTO userDTO = CreateUserDTO(userName, "12345", "*****@*****.**", contactDTO);
   final UserDTO response = userServiceBean.addUser(userDTO);
   Assert.assertNotNull(response);
   final UserDTO gotUserDTO = userServiceBean.getUserByUserName(userName);
   Assert.assertNotNull(gotUserDTO);
 }
Example #3
0
 @Test(expected = IllegalArgumentException.class)
 public void getUserByUserNameNotExistsIT() {
   final String userName = "******";
   userServiceBean.getUserByUserName(userName);
 }