@Test
  public void shouldChangeUserPasswordWhenAsked() {
    User updatedUser = new User();
    updatedUser.setUserName(user.getUserName());
    updatedUser.setPasswordHash("newpass");
    when(userMapper.findByUsername(user.getUserName())).thenReturn(updatedUser);

    boolean ret = userService.password(user, "newpass");
    verify(userMapper).update(user);
    assertEquals(userService.getByUsername(user.getUserName()).getPasswordHash(), "newpass");
    assertEquals(ret, true);
  }
  @Test
  public void shouldReturnTrueWhenUserDisabledSuccess() {
    user.setEnabled(true);

    User disabledUser = new User();
    disabledUser.setEnabled(false);
    disabledUser.setUserName("user");
    when(userMapper.findByUsername("user")).thenReturn(disabledUser);

    assertTrue(userService.disable(user));
    verify(userMapper).update(user);
    assertFalse(userService.getByUsername("user").isEnabled());
  }