AuthorizationConfigControllerTestIT from master
@@ -12,8 +12,8 @@ import org.carlspring.strongbox.rest.common.RestAssuredBaseTest;
import org.carlspring.strongbox.users.domain.Privileges;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
-import org.springframework.boot.test.context.SpringBootTest;
import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.http.HttpStatus;
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
+import java.util.stream.Stream;
import static io.restassured.module.mockmvc.RestAssuredMockMvc.given;
import static org.carlspring.strongbox.controllers.configuration.security.authorization.AuthorizationConfigController.*;
@@ -42,6 +43,26 @@ public class AuthorizationConfigControllerTestIT
private AuthorizationConfigDto config;
+ private static final String EXISTING_ROLE = "USER_ROLE";
+
+ private static Stream<Arguments> privilegesProvider()
+ {
+ return Stream.of(
+ Arguments.of("ADMIN_LIST_REPO", MediaType.APPLICATION_JSON_VALUE),
+ Arguments.of("ARTIFACTS_DEPLOY", MediaType.TEXT_PLAIN_VALUE)
+ );
+ }
+
+ private static Stream<Arguments> rolesProvider()
+ {
+ return Stream.of(
+ Arguments.of(EXISTING_ROLE, MediaType.APPLICATION_JSON_VALUE),
+ Arguments.of(EXISTING_ROLE, MediaType.TEXT_PLAIN_VALUE),
+ Arguments.of(StringUtils.EMPTY, MediaType.APPLICATION_JSON_VALUE),
+ Arguments.of(StringUtils.EMPTY, MediaType.TEXT_PLAIN_VALUE)
+ );
+ }
+
@Override
@BeforeEach
public void init()
