@Test
public void whenCreateUserThenGetIt() {

    UserRegister user = new UserRegister();
    user.setLogin("testlogin");
    user.setEmail("test@email.com");
    user.setFirstName("First");
    user.setLastName("Last");
    user.setPassword("password");
    user.setLangKey("en");
    this.userService.register(user);
    User result = this.userRepository.findOneWithAuthoritiesByLogin("testlogin").get();
    assertEquals(result.getLogin(), user.getLogin());
    assertEquals(result.getLogin(), user.getLogin());
    assertTrue(result.getAuthorities().contains(this.authorityRepository.findById(Constants.USER_AUTHORITY).get()));
}