From 8862d1b6c64ecfbbf43e4126663555b2422f3589 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Tue, 14 Nov 2023 11:50:55 +0100 Subject: [PATCH] Fixed tests --- .../src/test/java/access/api/UserRoleControllerTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/access/api/UserRoleControllerTest.java b/server/src/test/java/access/api/UserRoleControllerTest.java index 280cd617..dc668f1e 100644 --- a/server/src/test/java/access/api/UserRoleControllerTest.java +++ b/server/src/test/java/access/api/UserRoleControllerTest.java @@ -16,6 +16,7 @@ import java.time.temporal.ChronoUnit; import java.util.List; +import static access.Seed.INVITER_SUB; import static access.Seed.MANAGE_SUB; import static io.restassured.RestAssured.given; import static org.junit.jupiter.api.Assertions.*; @@ -107,9 +108,9 @@ void deleteUserRole() throws Exception { @Test void deleteUserRoleNotAllowed() throws Exception { - AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", MANAGE_SUB); - List userRoles = userRoleRepository.findByRoleName("Wiki"); - UserRole guestUserRole = userRoles.stream().filter(userRole -> userRole.getAuthority().equals(Authority.MANAGER)).findFirst().get(); + AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", INVITER_SUB); + List userRoles = userRoleRepository.findByRoleName("Calendar"); + UserRole guestUserRole = userRoles.stream().filter(userRole -> userRole.getAuthority().equals(Authority.INVITER)).findFirst().get(); given() .when() .filter(accessCookieFilter.cookieFilter())