-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added failing testcase for issue 1563 .
- Loading branch information
Jeremy Whiting
committed
Apr 2, 2024
1 parent
7dea250
commit c5cbb87
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,4 +425,23 @@ private void assertUserSearch(String search, String... expected) { | |
assertThrows(ForbiddenException.class, () -> userService.updateAdministrators(null)); | ||
}); | ||
} | ||
|
||
@TestSecurity(user = KEYCLOAK_ADMIN, roles = { Roles.ADMIN }) | ||
@Test void userCountAfterDeleteTeamTest() { | ||
int beforeCount = userService.searchUsers("").size(); | ||
String testTeam = "funky-test-team", otherTeam = "some-team-that-does-not-exist-team"; | ||
userService.addTeam(testTeam); | ||
String testUserName = "funky-team-user"; | ||
|
||
// create a test user | ||
UserService.NewUser testUser = new UserService.NewUser(); | ||
testUser.user = new UserService.UserData("", testUserName, "Fun", "Key", "[email protected]"); | ||
testUser.password = "secret"; | ||
testUser.team = testTeam; | ||
testUser.roles = Collections.emptyList(); | ||
userService.createUser(testUser); | ||
assertEquals(beforeCount + 1, userService.searchUsers("").size()); | ||
userService.deleteTeam (testTeam); | ||
assertEquals(beforeCount, userService.searchUsers("").size()); | ||
} | ||
} |