Skip to content

Commit 90785e0

Browse files
committed
Updating the test output message
1 parent 21c1f64 commit 90785e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

servlet/servlet-basicauth-file/src/test/java/org/javaee7/servlet/security/SecureServletTest.java

+8-2
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)