@Test
public void testUserCheckInvalidPassword() {

    final UserEntity userEntity = new UserEntity();
    userEntity.setPassword(VALID_PASSWORD);
    Mockito.when(mockUserService.findByName(VALID_USERNAME)).thenReturn(userEntity);
    Mockito.when(mockUserService.matches(INVALID_PASSWORD, VALID_PASSWORD)).thenReturn(false);
    Assert.assertFalse(defaultAuthenticationService.userPasswordCheck(VALID_USERNAME, INVALID_PASSWORD));
    Mockito.verify(mockUserService).findByName(VALID_USERNAME);
    Mockito.verify(mockUserService).matches(INVALID_PASSWORD, VALID_PASSWORD);
}