Skip to content

Commit

Permalink
chore: slightly adjust perm test
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Jan 11, 2025
1 parent 5979722 commit 74a3e73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ void testHasAllWithProjectOnly() throws Exception {
}

@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));
}

Expand All @@ -34,10 +33,9 @@ void testHasAnyWithProjectOnly() throws Exception {
}

@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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -144,7 +143,6 @@ public void prepare() {

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);

Expand Down

0 comments on commit 74a3e73

Please sign in to comment.