Beispiel #1
0
 @Test
 public void testAnonymousDisallowed() throws Exception {
   setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(false));
   start();
   try {
     URL url = new URL(getBaseURL());
     HttpURLConnection conn = (HttpURLConnection) url.openConnection();
     conn.connect();
     assertEquals(HttpURLConnection.HTTP_UNAUTHORIZED, conn.getResponseCode());
   } finally {
     stop();
   }
 }
Beispiel #2
0
 @Test
 public void testAuthenticationAnonymousDisallowedWithPost() throws Exception {
   setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(false));
   _testAuthentication(new PseudoAuthenticator(), true);
 }
Beispiel #3
0
 @Test
 public void testAuthenticationAnonymousAllowed() throws Exception {
   setAuthenticationHandlerConfig(getAuthenticationHandlerConfiguration(true));
   _testAuthentication(new PseudoAuthenticator(), false);
 }