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

Method testUnSuspendUser

src/test/java/dbProcs/SetterTest.java:650–696  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

648 }
649
650 @Test
651 public void testUnSuspendUser()
652 {
653 String userName = new String("UnsuspendedUser");
654 try
655 {
656 log.debug("Checking User Name in DB");
657 if(!GetterTest.verifyTestUser(applicationRoot, userName, userName))
658 {
659 fail("Could not Verify User");
660 }
661 else
662 {
663 String userId = Getter.getUserIdFromName(applicationRoot, userName);
664 if(!Setter.suspendUser(applicationRoot, userId, 10))
665 {
666 fail("Could not suspend User");
667 }
668 else
669 {
670 if(!Setter.unSuspendUser(applicationRoot, userId))
671 {
672 fail("Could not unsusepend user");
673 }
674 else
675 {
676 //Gotta Sleep for a sec, otherwise the time compair will round down and user auth will fail. User is unsuspended 1 second after unsuspend funciton
677 Thread.sleep(1000);
678 String user[] = Getter.authUser(applicationRoot, userName, userName);
679 if(user == null || user[0].isEmpty())
680 {
681 fail("Could not Authenticate after unsuspension");
682 }
683 else
684 {
685 return;// PASS: User Could not Authenticate after unsuspension
686 }
687 }
688 }
689 }
690 }
691 catch(Exception e)
692 {
693 log.fatal("Could not complete testUnSuspendUser: " + e.toString());
694 fail("Could not complete testUnSuspendUser");
695 }
696 }
697
698 @Test
699 public void testUpdatePassword()

Callers

nothing calls this directly

Calls 5

verifyTestUserMethod · 0.95
getUserIdFromNameMethod · 0.95
suspendUserMethod · 0.95
unSuspendUserMethod · 0.95
authUserMethod · 0.95

Tested by

no test coverage detected