diff --git a/pom.xml b/pom.xml
index 6b9004643c..225e6140ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,24 +54,20 @@
io.quarkus
- quarkus-resteasy
+ quarkus-resteasy-reactive-jackson
io.quarkus
- quarkus-rest-client
+ quarkus-resteasy-reactive-qute
io.quarkus
- quarkus-resteasy-jackson
+ quarkus-rest-client-reactive
io.quarkus
quarkus-mutiny
-
- io.quarkus
- quarkus-resteasy-mutiny
-
io.quarkus
quarkus-smallrye-context-propagation
@@ -112,10 +108,6 @@
io.quarkus
quarkus-cache
-
- io.quarkus
- quarkus-resteasy-qute
-
io.quarkus
quarkus-hibernate-reactive
diff --git a/src/main/java/com/redhat/cloud/notifications/routers/InternalService.java b/src/main/java/com/redhat/cloud/notifications/routers/InternalService.java
index 4d6e1ef17d..0f5a090147 100644
--- a/src/main/java/com/redhat/cloud/notifications/routers/InternalService.java
+++ b/src/main/java/com/redhat/cloud/notifications/routers/InternalService.java
@@ -11,6 +11,7 @@
import javax.inject.Inject;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.NotFoundException;
@@ -18,11 +19,16 @@
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.UUID;
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+
@Path("/internal")
+@Consumes(APPLICATION_JSON)
+@Produces(APPLICATION_JSON)
public class InternalService {
@Inject
diff --git a/src/test/java/com/redhat/cloud/notifications/routers/AuthenticationTest.java b/src/test/java/com/redhat/cloud/notifications/routers/AuthenticationTest.java
index 72f50d2826..5123586dfb 100644
--- a/src/test/java/com/redhat/cloud/notifications/routers/AuthenticationTest.java
+++ b/src/test/java/com/redhat/cloud/notifications/routers/AuthenticationTest.java
@@ -5,6 +5,9 @@
import com.redhat.cloud.notifications.TestConstants;
import com.redhat.cloud.notifications.TestHelpers;
import com.redhat.cloud.notifications.TestLifecycleManager;
+import io.quarkus.cache.Cache;
+import io.quarkus.cache.CacheName;
+import io.quarkus.cache.runtime.caffeine.CaffeineCache;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
@@ -26,6 +29,9 @@ void beforeEach() {
@MockServerConfig
MockServerClientConfig mockServerConfig;
+ @CacheName("rbac-cache")
+ Cache cache;
+
@Test
void testEndpointRoles() {
String tenant = "empty";
@@ -40,6 +46,8 @@ void testEndpointRoles() {
.then()
.statusCode(401);
+ clearRbacCache();
+
// Fetch endpoint without any Rbac details - errors cause 401
given()
// Set header to x-rh-identity
@@ -48,6 +56,8 @@ void testEndpointRoles() {
.then()
.statusCode(401);
+ clearRbacCache();
+
// Fetch endpoint with no access - Rbac succeed returns 403
mockServerConfig.addMockRbacAccess(identityHeaderValue, MockServerClientConfig.RbacAccess.NO_ACCESS);
@@ -58,6 +68,8 @@ void testEndpointRoles() {
.then()
.statusCode(403);
+ clearRbacCache();
+
// Test bogus x-rh-identity header that fails Base64 decoding
given()
.header(new Header("x-rh-identity", "00000"))
@@ -65,4 +77,12 @@ void testEndpointRoles() {
.then()
.statusCode(401);
}
+
+ private void clearRbacCache() {
+ /*
+ * TODO Replace with real programmatic API call when it will be available. For now we have to rely on this "hack".
+ * See https://github.com/quarkusio/quarkus/pull/8631
+ */
+ ((CaffeineCache) cache).invalidateAll();
+ }
}
diff --git a/src/test/java/com/redhat/cloud/notifications/routers/NotificationServiceTest.java b/src/test/java/com/redhat/cloud/notifications/routers/NotificationServiceTest.java
index 78779e4b53..198035a7a8 100644
--- a/src/test/java/com/redhat/cloud/notifications/routers/NotificationServiceTest.java
+++ b/src/test/java/com/redhat/cloud/notifications/routers/NotificationServiceTest.java
@@ -9,6 +9,7 @@
import com.redhat.cloud.notifications.db.DbIsolatedTest;
import com.redhat.cloud.notifications.db.ResourceHelpers;
import com.redhat.cloud.notifications.models.Application;
+import com.redhat.cloud.notifications.models.BehaviorGroup;
import com.redhat.cloud.notifications.models.Endpoint;
import com.redhat.cloud.notifications.models.EndpointType;
import com.redhat.cloud.notifications.models.EventType;
@@ -573,6 +574,8 @@ void testInsufficientPrivileges() {
given()
.header(readAccessIdentityHeader)
.contentType(ContentType.JSON)
+ // TODO Remove the body when https://github.com/quarkusio/quarkus/issues/16897 is fixed
+ .body(Json.encode(new BehaviorGroup()))
.when()
.post("/notifications/behaviorGroups")
.then()
@@ -582,6 +585,8 @@ void testInsufficientPrivileges() {
.header(readAccessIdentityHeader)
.contentType(ContentType.JSON)
.pathParam("id", UUID.randomUUID())
+ // TODO Remove the body when https://github.com/quarkusio/quarkus/issues/16897 is fixed
+ .body(Json.encode(new BehaviorGroup()))
.when()
.put("/notifications/behaviorGroups/{id}")
.then()