@Test
public void testAuthenticateUserDigestValid() throws Exception {

	User user = new User(username, password, true, true, true, true, Collections.<GrantedAuthority> emptyList());
	expect(userDetailsService.loadUserByUsername(username)).andReturn(user);
	replay(userDetailsService);
	callbackHandler.handleInternal(callback);
	boolean authenticated = callback.getResult();
	Assert.assertTrue("Not authenticated", authenticated);
	Assert.assertNotNull("No Authentication created", SecurityContextHolder.getContext().getAuthentication());
	verify(userDetailsService);
}