@Test
public void testUserPasswordCheck() {

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