@Test(timeout=60000) public void testNotAuthenticated() throws Exception { AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration()); auth.start(); try { URL url = new URL(auth.getBaseURL()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.connect(); Assert.assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, conn.getResponseCode()); Assert.assertTrue(conn.getHeaderField(KerberosAuthenticator.WWW_AUTHENTICATE) != null); } finally { auth.stop(); } }
@Test(timeout=60000) public void testNotAuthenticated() throws Exception { AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration()); auth.start(); try { URL url = new URL(auth.getBaseURL()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.connect(); Assert.assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, conn.getResponseCode()); Assert.assertTrue(conn.getHeaderField(KerberosAuthenticator.WWW_AUTHENTICATE) != null); } finally { auth.stop(); } }
@Test(timeout=60000) public void testNotAuthenticated() throws Exception { AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration()); auth.start(); try { URL url = new URL(auth.getBaseURL()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.connect(); Assert.assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, conn.getResponseCode()); Assert.assertTrue(conn.getHeaderField(KerberosAuthenticator.WWW_AUTHENTICATE) != null); } finally { auth.stop(); } }
@Test(timeout=60000) public void testAuthenticationHttpClient() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), false); return null; } }); }
@Test(timeout=60000) public void testAuthentication() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), false); return null; } }); }
@Test(timeout=60000) public void testAuthenticationHttpClientPost() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } }); }
@Test(timeout=60000) public void testAuthenticationHttpClient() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), false); return null; } }); }
@Test(timeout=60000) public void testAuthentication() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), false); return null; } }); }
@Test(timeout=60000) public void testAuthenticationPost() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } }); }
@Test(timeout=60000) public void testAuthenticationHttpClientPost() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } }); }
@Test(timeout=60000) public void testAuthentication() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), false); return null; } }); }
@Test(timeout=60000) public void testAuthenticationPost() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } }); }
@Test(timeout=60000) public void testAuthenticationPost() throws Exception { final AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.setAuthenticationHandlerConfig( getAuthenticationHandlerConfiguration()); KerberosTestUtils.doAsClient(new Callable<Void>() { @Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } }); } }