@Test
public void whenLoadExistingUser() {

    UserRegister user = new UserRegister();
    user.setEmail("test@email.com");
    user.setLogin("testlogin");
    user.setFirstName("First");
    user.setLastName("Last");
    user.setPassword("password");
    user.setLangKey("en");
    this.userService.register(user);
    User editUser = this.userService.getByLogin(user.getLogin()).get();
    editUser.setActivated(true);
    this.userRepository.save(editUser);
    String userId = this.userService.getByLogin(user.getLogin()).get().getId();
    assertEquals(this.artaeumUserDetailsService.loadUserByUsername("testlogin").getUsername(), userId);
    assertEquals(this.artaeumUserDetailsService.loadUserByUsername("test@email.com").getUsername(), userId);
}