File tree 1 file changed +8
-2
lines changed
servlet/servlet-basicauth-file/src/test/java/org/javaee7/servlet/security
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 {
39
39
WebConversation conv = new WebConversation ();
40
40
conv .setAuthentication ("file" , "u1" , "p1" );
41
41
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>" ));
44
50
}
45
51
46
52
@ Test
You can’t perform that action at this time.
0 commit comments