@Test
public void testAuthenticateUserPlainTextValid() throws Exception {

	Authentication authResult = new TestingAuthenticationToken(username, password,
			Collections.<GrantedAuthority> emptyList());
	expect(authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password)))
			.andReturn(authResult);
	replay(authenticationManager);
	callbackHandler.handleInternal(callback);
	boolean authenticated = callback.getResult();
	Assert.assertTrue("Not authenticated", authenticated);
	Assert.assertNotNull("No Authentication created", SecurityContextHolder.getContext().getAuthentication());
	verify(authenticationManager);
}