@Test(expected = AmbariException.class)
public void testCheckFailed() throws Exception {

  Configuration config = createMock(Configuration.class);
  LoginContextHelper loginContextHelper = createMock(LoginContextHelper.class);
  expect(config.isKerberosJaasConfigurationCheckEnabled()).andReturn(true).once();
  expect(loginContextHelper.createLoginContext(KerberosChecker.HTTP_SPNEGO_STANDARD_ENTRY)).andThrow(new LoginException()).once();
  replayAll();
  KerberosChecker.config = config;
  KerberosChecker.loginContextHelper = loginContextHelper;
  KerberosChecker.checkJaasConfiguration();
  verifyAll();
}