Beispiel #1
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);
 }
Beispiel #2
0
 @Test(expected = IllegalArgumentException.class)
 public void addUserEmailAddressExistsIT() {
   final ContactDTO contactDTO =
       createContactDTO("Marcel", "Becker", "56076", "Koblenz", "Am Kratzkopfer Hof 1");
   final UserDTO userDTO =
       CreateUserDTO("tuxdevelop", "12345", "*****@*****.**", contactDTO);
   final UserDTO response = userServiceBean.addUser(userDTO);
   Assert.assertNotNull(response);
   final UserDTO secondUserDTO =
       CreateUserDTO("tuxdevelop2", "12345", "*****@*****.**", contactDTO);
   userServiceBean.addUser(secondUserDTO);
 }
Beispiel #3
0
 @Test
 public void addUserIT() {
   // authenticate("tuxdevelop", "tuxdevelop");
   final ContactDTO contactDTO =
       createContactDTO("Marcel", "Becker", "56076", "Koblenz", "Am Kratzkopfer Hof 1");
   final UserDTO userDTO =
       CreateUserDTO("tuxdevelop", "12345", "*****@*****.**", contactDTO);
   final UserDTO response = userServiceBean.addUser(userDTO);
   Assert.assertNotNull(response);
 }
Beispiel #4
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());
 }
Beispiel #5
0
 @Test(expected = IllegalArgumentException.class)
 public void getUserByUserNameNotExistsIT() {
   final String userName = "******";
   userServiceBean.getUserByUserName(userName);
 }