File tree 1 file changed +3
-2
lines changed
servlet/security-basicauth/src/test/java/org/javaee7/servlet/security/basicauth
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public static WebArchive createDeployment() {
35
35
}
36
36
37
37
@ Test
38
- public void testSecureServletWithCorrectCredentials () throws Exception {
38
+ public void testWithCorrectCredentials () throws Exception {
39
39
WebConversation conv = new WebConversation ();
40
40
conv .setAuthentication ("file" , "u1" , "p1" );
41
41
GetMethodWebRequest getRequest = new GetMethodWebRequest (base + "/SecureServlet" );
@@ -50,14 +50,15 @@ public void testSecureServletWithCorrectCredentials() throws Exception {
50
50
}
51
51
52
52
@ Test
53
- public void testSecureServletWithIncorrectCredentials () throws Exception {
53
+ public void testWithIncorrectCredentials () throws Exception {
54
54
WebConversation conv = new WebConversation ();
55
55
conv .setAuthentication ("file" , "u" , "p1" );
56
56
GetMethodWebRequest getRequest = new GetMethodWebRequest (base + "/SecureServlet" );
57
57
try {
58
58
conv .getResponse (getRequest );
59
59
} catch (AuthorizationRequiredException e ) {
60
60
assertNotNull (e );
61
+ assertEquals ("Basic" , e .getAuthenticationScheme ());
61
62
return ;
62
63
}
63
64
fail ("/SecureServlet could be accessed without proper security credentials" );
You can’t perform that action at this time.
0 commit comments