예제 #1
0
 @Test
 public void testChallengeGET() throws IOException {
   SimpleHttpRequest request = new SimpleHttpRequest();
   request.setMethod("GET");
   request.setQueryString("j_negotiate_check");
   SimpleHttpResponse response = new SimpleHttpResponse();
   _authenticator.authenticate(request, response);
   String[] wwwAuthenticates = response.getHeaderValues("WWW-Authenticate");
   assertEquals(2, wwwAuthenticates.length);
   assertEquals("Negotiate", wwwAuthenticates[0]);
   assertEquals("NTLM", wwwAuthenticates[1]);
   assertEquals("close", response.getHeader("Connection"));
   assertEquals(2, response.getHeaderNames().size());
   assertEquals(401, response.getStatus());
 }
 /** Test challenge get. */
 @Test
 public void testChallengeGET() {
   final SimpleHttpRequest request = new SimpleHttpRequest();
   request.setMethod("GET");
   final SimpleHttpResponse response = new SimpleHttpResponse();
   this.authenticator.authenticate(request, response);
   final String[] wwwAuthenticates = response.getHeaderValues("WWW-Authenticate");
   Assert.assertNotNull(wwwAuthenticates);
   Assert.assertEquals(2, wwwAuthenticates.length);
   Assert.assertEquals("Negotiate", wwwAuthenticates[0]);
   Assert.assertEquals("NTLM", wwwAuthenticates[1]);
   Assert.assertEquals("close", response.getHeader("Connection"));
   Assert.assertEquals(2, response.getHeaderNames().size());
   Assert.assertEquals(401, response.getStatus());
 }