// Create UserService mock
UserService service = mock(UserService.class);
when(service.register(any(String.class), any(String.class), any(String.class), Matchers.anyListOf(Role.class))).thenReturn(user);
when(service.login(any(String.class), any(String.class))).thenReturn(Optional.of(user));
RegistrationRequest req = new RegistrationRequest();
req.setName("user");
req.setPassword("password");
req.setEmail("test@test.com");
SessionHelper sessionHelper = mock(SessionHelper.class);
UserREST userREST = new UserREST(null, null, null, service, null, null, null);
userREST.register(req, sessionHelper);