@Test
public void testValidateCertificateValid() throws Exception {

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