use of com.epam.ta.reportportal.ws.model.user.EditUserRQ in project service-api by reportportal.
the class EditUserHandlerImplTest method editExternalUserFullName.
@Test
void editExternalUserFullName() {
User user = new User();
user.setUserType(UserType.GITHUB);
when(userRepository.findByLogin("test")).thenReturn(Optional.of(user));
final EditUserRQ editUserRQ = new EditUserRQ();
editUserRQ.setFullName("full name");
final ReportPortalException exception = assertThrows(ReportPortalException.class, () -> handler.editUser("test", editUserRQ, getRpUser("not_exist", UserRole.USER, ProjectRole.MEMBER, 1L)));
assertEquals("You do not have enough permissions. Unable to change full name for external user", exception.getMessage());
}
use of com.epam.ta.reportportal.ws.model.user.EditUserRQ in project service-api by reportportal.
the class EditUserHandlerImplTest method changeExternalUserEmail.
@Test
void changeExternalUserEmail() {
User user = new User();
user.setUserType(UserType.LDAP);
when(userRepository.findByLogin("test")).thenReturn(Optional.of(user));
final EditUserRQ editUserRQ = new EditUserRQ();
editUserRQ.setEmail("newemail@domain.com");
final ReportPortalException exception = assertThrows(ReportPortalException.class, () -> handler.editUser("test", editUserRQ, getRpUser("not_exist", UserRole.USER, ProjectRole.MEMBER, 1L)));
assertEquals("You do not have enough permissions. Unable to change email for external user", exception.getMessage());
}
Aggregations