diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java index a1b4d09f85..6d5abf9dc7 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/assets/DashboardControllerIT.java @@ -20,6 +20,9 @@ package org.eclipse.tractusx.traceability.integration.assets; import io.restassured.http.ContentType; +import notification.request.NotificationSeverityRequest; +import notification.request.NotificationTypeRequest; +import notification.request.StartNotificationRequest; import org.eclipse.tractusx.traceability.assets.domain.base.model.Owner; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.model.AssetAsBuiltEntity; import org.eclipse.tractusx.traceability.assets.infrastructure.asbuilt.repository.JpaAssetAsBuiltRepository; @@ -36,9 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; -import notification.request.NotificationSeverityRequest; -import notification.request.NotificationTypeRequest; -import notification.request.StartNotificationRequest; import java.util.List; import java.util.stream.Stream; @@ -155,6 +155,20 @@ void givenNoRoles_whenGetDashboard_thenReturn401() throws JoseException { .then().statusCode(401); } + @Test + void givenNoRoles_whenGetDashboard_thenReturn403() throws JoseException { + // given + assetsSupport.defaultAssetsStored(); + + // when/then + given() + .header(oAuth2Support.jwtAuthorizationWithNoRole()) + .contentType(ContentType.JSON) + .log().all() + .when().get("/api/dashboard") + .then().statusCode(403); + } + @Test void givenPendingInvestigation_whenGetDashboard_thenReturnPendingInvestigation() throws JoseException, JsonProcessingException { // given