chore: slightly adjust perm test

This commit is contained in:
MiniDigger | Martin 2025-01-11 13:10:41 +01:00
parent 59797226e4
commit 74a3e7325c
2 changed files with 2 additions and 6 deletions

View File

@ -18,10 +18,9 @@ class PermissionsControllerTest extends ControllerTest {
}
@Test
@Disabled //TODO fix wtf is going on here
void testHasAllWithAll() throws Exception {
this.mockMvc.perform(get("/api/v1/permissions/hasAll?permissions=create_organization&permissions=create_project")
.with(this.apiKey(TestData.KEY_ALL)))
.with(this.apiKey(TestData.KEY_ADMIN)))
.andExpect(jsonPath("$.result").value(true));
}
@ -34,10 +33,9 @@ class PermissionsControllerTest extends ControllerTest {
}
@Test
@Disabled //TODO fix wtf is going on here
void testHasAnyWithAll() throws Exception {
this.mockMvc.perform(get("/api/v1/permissions/hasAny?permissions=create_organization&permissions=create_project")
.with(this.apiKey(TestData.KEY_ALL)))
.with(this.apiKey(TestData.KEY_ADMIN)))
.andExpect(jsonPath("$.result").value(true));
}

View File

@ -59,7 +59,6 @@ public class TestData {
public static UserTable USER_BANNED;
public static String KEY_ADMIN;
public static String KEY_ALL;
public static String KEY_PROJECT_ONLY;
public static String KEY_SEE_HIDDEN;
@ -144,7 +143,6 @@ public class TestData {
logger.info("Creating test api keys...");
KEY_ADMIN = this.apiKeyService.createApiKey(USER_ADMIN, new CreateAPIKeyForm("Admin", Set.of(NamedPermission.values())), Permission.All);
KEY_ALL = this.apiKeyService.createApiKey(USER_NORMAL, new CreateAPIKeyForm("All", new HashSet<>(Permission.fromBinString("0000000000000000000011110000111100001111001100001111011111110111").toNamed())), Permission.All);
KEY_PROJECT_ONLY = this.apiKeyService.createApiKey(USER_NORMAL, new CreateAPIKeyForm("Project Only", Set.of(NamedPermission.CREATE_PROJECT)), Permission.All);
KEY_SEE_HIDDEN = this.apiKeyService.createApiKey(USER_NORMAL, new CreateAPIKeyForm("See Hidden", Set.of(NamedPermission.SEE_HIDDEN)), Permission.All);