Skip to content

Commit 5c6714e

Browse files
committed
Improved the test
1 parent 0ea9851 commit 5c6714e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static WebArchive createDeployment() {
3535
}
3636

3737
@Test
38-
public void testSecureServletWithCorrectCredentials() throws Exception {
38+
public void testWithCorrectCredentials() throws Exception {
3939
WebConversation conv = new WebConversation();
4040
conv.setAuthentication("file", "u1", "p1");
4141
GetMethodWebRequest getRequest = new GetMethodWebRequest(base + "/SecureServlet");
@@ -50,14 +50,15 @@ public void testSecureServletWithCorrectCredentials() throws Exception {
5050
}
5151

5252
@Test
53-
public void testSecureServletWithIncorrectCredentials() throws Exception {
53+
public void testWithIncorrectCredentials() throws Exception {
5454
WebConversation conv = new WebConversation();
5555
conv.setAuthentication("file", "u", "p1");
5656
GetMethodWebRequest getRequest = new GetMethodWebRequest(base + "/SecureServlet");
5757
try {
5858
conv.getResponse(getRequest);
5959
} catch (AuthorizationRequiredException e) {
6060
assertNotNull(e);
61+
assertEquals("Basic", e.getAuthenticationScheme());
6162
return;
6263
}
6364
fail("/SecureServlet could be accessed without proper security credentials");

0 commit comments

Comments
 (0)