File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
servlet/servlet-basicauth-file/src/test/java/org/javaee7/servlet/security Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,14 @@ public void testSecureServletWithCorrectCredentials() throws Exception {
3939 WebConversation conv = new WebConversation ();
4040 conv .setAuthentication ("file" , "u1" , "p1" );
4141 GetMethodWebRequest getRequest = new GetMethodWebRequest (base + "/SecureServlet" );
42- WebResponse getResponse = conv .getResponse (getRequest );
43- assertTrue (getResponse .getText ().contains ("<title>Servlet Security - Basic Auth with File-base Realm</title>" ));
42+ WebResponse response = null ;
43+ try {
44+ response = conv .getResponse (getRequest );
45+ } catch (AuthorizationRequiredException e ) {
46+ fail (e .getMessage ());
47+ }
48+ assertNotNull (response );
49+ assertTrue (response .getText ().contains ("<title>Servlet Security - Basic Auth with File-base Realm</title>" ));
4450 }
4551
4652 @ Test
You can’t perform that action at this time.
0 commit comments