MCPcopy Create free account
hub / github.com/OWASP/SecurityShepherd / testAdminLogin

Method testAdminLogin

src/test/java/servlets/LoginTest.java:232–257  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 }
231
232 @Test
233 public void testAdminLogin()
234 {
235 String userName = "adminLogin1";
236 try
237 {
238 GetterTest.verifyTestAdmin(applicationRoot, userName, userName);
239 loginDoPost(userName, userName, null);
240 HttpSession ses = request.getSession();
241 if(!ses.getAttribute("userRole").toString().equalsIgnoreCase("admin"))
242 {
243 String message = new String("User has player role after login when they should be admin");
244 log.fatal(message);
245 fail(message);
246 }
247 else
248 {
249 log.debug("Admin Logged in and has Admin Session. PASS");
250 }
251 }
252 catch(Exception e)
253 {
254 log.fatal("Could not Complete testUserLogin: " + e.toString());
255 fail("Could not Complete testUserLogin");
256 }
257 }
258
259 @Test
260 public void testUserLoginWithBadPass()

Callers

nothing calls this directly

Calls 3

verifyTestAdminMethod · 0.95
loginDoPostMethod · 0.95
getSessionMethod · 0.80

Tested by

no test coverage detected