Skip to content

Commit

Permalink
Workaround for Quarkus 3.16 regression
Browse files Browse the repository at this point in the history
See [Quarkus issue 44235](quarkusio/quarkus#44235)
  • Loading branch information
snazy committed Nov 11, 2024
1 parent 546c0c4 commit a2a528b
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.projectnessie.server;

import com.google.common.collect.ImmutableMap;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.QuarkusTestProfile;
Expand All @@ -26,7 +27,9 @@
import org.projectnessie.server.authn.AuthenticationEnabledProfile;

@QuarkusIntegrationTest
@WithTestResource(KeycloakTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = KeycloakTestResourceLifecycleManager.class)
@TestProfile(value = ITBearerAuthentication.Profile.class)
public class ITBearerAuthentication extends AbstractBearerAuthentication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.common.collect.ImmutableMap;
import io.quarkus.test.common.ResourceArg;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.QuarkusTestProfile;
Expand All @@ -35,6 +36,7 @@

@QuarkusIntegrationTest
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = KeycloakTestResourceLifecycleManager.class,
initArgs =
@ResourceArg(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static java.util.UUID.randomUUID;

import com.google.common.collect.ImmutableMap;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import java.net.URI;
Expand All @@ -29,7 +30,9 @@
import org.projectnessie.server.catalog.WarehouseAccountSecret;
import org.projectnessie.server.catalog.WarehouseLocation;

@WithTestResource(AzuriteTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = AzuriteTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
public class ITAdlsIcebergCatalog extends AbstractIcebergCatalogIntTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.projectnessie.server.catalog.ObjectStorageMockTestResourceLifecycleManager.bucketWarehouseLocation;

import com.google.common.collect.ImmutableMap;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTestProfile;
import java.lang.reflect.Field;
Expand All @@ -43,7 +44,9 @@
import org.projectnessie.server.catalog.AbstractIcebergCatalogTests;
import org.projectnessie.server.catalog.ObjectStorageMockTestResourceLifecycleManager;

@WithTestResource(parallel = true, value = KeycloakTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = KeycloakTestResourceLifecycleManager.class)
public abstract class AbstractAuthEnabledTests extends AbstractIcebergCatalogTests {

@KeycloakTokenEndpointUri protected URI tokenEndpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.projectnessie.server.catalog.auth;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.TestProfile;
Expand All @@ -31,8 +32,12 @@
import org.projectnessie.testing.keycloak.OAuthUtils;
import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;

@WithTestResource(MinioTestResourceLifecycleManager.class)
@WithTestResource(KeycloakTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = KeycloakTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
@TestProfile(ITOAuthTrinoS3.Profile.class)
public class ITOAuthTrinoS3 extends AbstractTrino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static java.util.UUID.randomUUID;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import java.net.URI;
Expand All @@ -27,7 +28,9 @@
import org.projectnessie.server.catalog.GcsToken;
import org.projectnessie.server.catalog.WarehouseLocation;

@WithTestResource(GcsEmulatorTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = GcsEmulatorTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
public class ITGcsIcebergCatalog extends AbstractIcebergCatalogIntTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
*/
package org.projectnessie.server.catalog.s3;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.TestProfile;
import org.projectnessie.server.catalog.MinioTestResourceLifecycleManager;

@WithTestResource(MinioTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
@TestProfile(ITS3AssumeRoleIceberg.Profile.class)
public class ITS3AssumeRoleIceberg extends AbstractAssumeRoleIceberg {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static java.util.Collections.singletonMap;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.QuarkusTestProfile;
Expand All @@ -32,7 +33,9 @@
import org.projectnessie.server.catalog.MinioTestResourceLifecycleManager;
import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;

@WithTestResource(MinioTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
@TestProfile(ITS3AssumeRoleIcebergCatalog.Profile.class)
public class ITS3AssumeRoleIcebergCatalog extends AbstractIcebergCatalogIntTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static java.util.Collections.singletonMap;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import java.util.HashMap;
Expand All @@ -32,7 +33,9 @@
import org.projectnessie.server.catalog.AbstractIcebergCatalogIntTests;
import org.projectnessie.server.catalog.MinioTestResourceLifecycleManager;

@WithTestResource(MinioTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
public class ITS3IcebergCatalog extends AbstractIcebergCatalogIntTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
package org.projectnessie.server.catalog.s3;

import io.quarkus.test.common.ResourceArg;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.TestProfile;
import org.projectnessie.server.catalog.MinioTestResourceLifecycleManager;

@WithTestResource(
initArgs = {@ResourceArg(name = "scheme", value = "s3n")},
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
@TestProfile(ITS3NAssumeRoleIceberg.Profile.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
*/
package org.projectnessie.server.catalog.s3;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import io.quarkus.test.junit.TestProfile;
import org.projectnessie.server.catalog.AbstractTrino;
import org.projectnessie.server.catalog.MinioTestResourceLifecycleManager;

@WithTestResource(MinioTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = MinioTestResourceLifecycleManager.class)
@QuarkusIntegrationTest
@TestProfile(ITTrinoS3.Profile.class)
public class ITTrinoS3 extends AbstractTrino {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
import static java.util.Locale.ROOT;
import static org.projectnessie.quarkus.config.QuarkusSecretsConfig.ExternalSecretsManagerType.AMAZON;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest // because the tests need @Inject'd fields
@WithTestResource(LocalstackTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = LocalstackTestResourceLifecycleManager.class)
public class ITSecretsAWS extends AbstractSecretsSuppliers {
@Override
protected String providerName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
import static java.util.Locale.ROOT;
import static org.projectnessie.quarkus.config.QuarkusSecretsConfig.ExternalSecretsManagerType.VAULT;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest // because the tests need @Inject'd fields
@WithTestResource(VaultTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = VaultTestResourceLifecycleManager.class)
public class ITSecretsVault extends AbstractSecretsSuppliers {
@Override
protected String providerName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
Expand All @@ -27,7 +28,9 @@
import org.projectnessie.server.authn.AuthenticationEnabledProfile;

@QuarkusTest
@WithTestResource(OidcWiremockTestResource.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = OidcWiremockTestResource.class)
@TestProfile(value = TestBearerAuthentication.Profile.class)
public class TestBearerAuthentication extends AbstractBearerAuthentication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.github.tomakehurst.wiremock.client.WireMock;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
Expand All @@ -53,7 +54,9 @@

@SuppressWarnings("resource")
@QuarkusTest
@WithTestResource(OidcWiremockTestResource.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = OidcWiremockTestResource.class)
@TestProfile(value = TestOAuth2Authentication.Profile.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class TestOAuth2Authentication extends AbstractOAuth2Authentication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.type.ArrayType;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import java.net.URI;
import java.util.ArrayList;
Expand All @@ -52,7 +53,9 @@
import org.projectnessie.objectstoragemock.HeapStorageBucket;
import org.projectnessie.server.catalog.ObjectStorageMockTestResourceLifecycleManager.AccessCheckHandlerHolder;

@WithTestResource(IcebergResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = IcebergResourceLifecycleManager.class)
public abstract class AbstractIcebergCatalogUnitTests extends AbstractIcebergCatalogTests {

HeapStorageBucket heapStorageBucket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
*/
package org.projectnessie.server.catalog;

import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import org.junit.jupiter.api.BeforeEach;
import org.projectnessie.objectstoragemock.HeapStorageBucket;

@WithTestResource(IcebergResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = IcebergResourceLifecycleManager.class)
public abstract class AbstractIcebergViewCatalogUnitTests extends AbstractIcebergViewCatalogTests {

HeapStorageBucket heapStorageBucket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.projectnessie.server.catalog.IcebergCatalogTestCommon.WAREHOUSE_NAME;

import com.google.common.collect.ImmutableMap;
import io.quarkus.test.common.TestResourceScope;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
Expand All @@ -44,8 +45,12 @@
import org.projectnessie.server.catalog.ObjectStorageMockTestResourceLifecycleManager.AssumeRoleHandlerHolder;
import org.projectnessie.server.catalog.S3UnitTestProfiles;

@WithTestResource(ObjectStorageMockTestResourceLifecycleManager.class)
@WithTestResource(IcebergResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = ObjectStorageMockTestResourceLifecycleManager.class)
@WithTestResource(
scope = TestResourceScope.RESTRICTED_TO_CLASS,
value = IcebergResourceLifecycleManager.class)
@QuarkusTest
@TestProfile(TestVendedS3CredentialsExpiry.Profile.class)
public class TestVendedS3CredentialsExpiry {
Expand Down

0 comments on commit a2a528b

Please sign in to comment.