@Test
public void testValidateCertificateInvalid() throws Exception {

	expect(authenticationManager.authenticate(isA(X509AuthenticationToken.class)))
			.andThrow(new BadCredentialsException(""));
	replay(authenticationManager);
	callbackHandler.handleInternal(callback);
	boolean authenticated = callback.getResult();
	Assert.assertFalse("Authenticated", authenticated);
	Assert.assertNull("Authentication created", SecurityContextHolder.getContext().getAuthentication());
	verify(authenticationManager);
}