mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-05 14:40:33 +08:00
chore: slightly adjust perm test
This commit is contained in:
parent
59797226e4
commit
74a3e7325c
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user