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

Method testUserDelete

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

Source from the content-addressed store, hash-verified

1113
1114
1115 @Test
1116 public void testUserDelete()
1117 {
1118 String testUsername = "testuserdelete";
1119 String testuserId = Getter.getUserIdFromName(applicationRoot, testUsername);
1120
1121 try {
1122 if(testuserId == null || testuserId.isEmpty())
1123 assert(Setter.userCreate(applicationRoot, null, testUsername, testUsername, "player", testUsername+"@test.com", false));
1124
1125 testuserId = Getter.getUserIdFromName(applicationRoot, testUsername);
1126 assert(testuserId != null && !testuserId.isEmpty());
1127
1128 assert(Setter.userDelete(applicationRoot, testuserId));
1129
1130 testuserId = Getter.getUserIdFromName(applicationRoot, testUsername);
1131 assert(testuserId == null || testuserId.isEmpty());
1132
1133 } catch (SQLException sqlEx) {
1134 log.fatal("DB Error: " + sqlEx.toString());
1135 fail("Could not Complete testUserDelete because DB Error");
1136 }
1137 }
1138}

Callers

nothing calls this directly

Calls 3

getUserIdFromNameMethod · 0.95
userCreateMethod · 0.95
userDeleteMethod · 0.95

Tested by

no test coverage detected