Skip to content

Commit

Permalink
chore(dashboard): 726 added test
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mmaul committed Apr 22, 2024
1 parent 8a3b206 commit 904981e
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 904981e

Please sign in to comment.