From 9e270fa93792313b36a9bad1f636a377266c68ee Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Wed, 21 Aug 2024 10:25:57 +0200 Subject: [PATCH 01/17] Upgrade opentelemetry-semconv to 1.26.0-alpha (cherry picked from commit c038ed9e89b3676e1cf153bf161fdc5ddf835956) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 44cb60419a78b..41662bf8f6309 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -33,7 +33,7 @@ 0.1.5 1.39.0 2.5.0-alpha - 1.25.0-alpha + 1.26.0-alpha 5.3.1 1.12.5 2.1.12 From edd3b6d96fca05dc6296febad3e8ca4580946be7 Mon Sep 17 00:00:00 2001 From: polarctos Date: Thu, 22 Aug 2024 09:58:16 +0200 Subject: [PATCH 02/17] Fix config encryption CLI command in guide The config command in the Quarkus CLI changed. Usage: quarkus config set [-ehk] [--verbose] NAME [VALUE] (cherry picked from commit a4337a24301e6a87f4aeb01e8d063ed91a07a366) --- docs/src/main/asciidoc/config-secrets.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/main/asciidoc/config-secrets.adoc b/docs/src/main/asciidoc/config-secrets.adoc index bebee8a9b6a8f..ec1a0c0e761ab 100644 --- a/docs/src/main/asciidoc/config-secrets.adoc +++ b/docs/src/main/asciidoc/config-secrets.adoc @@ -33,7 +33,7 @@ Use the Quarkus CLI command to add a new encrypted value or encrypt an existent **** [source, bash] ---- -quarkus config set --encrypt --name=my.secret --value=1234 +quarkus config set --encrypt my.secret 1234 ---- _For more information about how to install the Quarkus CLI and use it, please refer to xref:cli-tooling.adoc[the Quarkus CLI guide]._ From 4802e0caee932eb107a87ae2a89eaee107348b92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:11:55 +0000 Subject: [PATCH 03/17] Bump org.postgresql:postgresql from 42.7.3 to 42.7.4 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.3 to 42.7.4. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.3...REL42.7.4) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit b2ee39922fefa6c0da2a341a077f74da2e06f7f7) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 41662bf8f6309..134da8f1297c5 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -120,7 +120,7 @@ 9.2.1 2.3.2 2.3.232 - 42.7.3 + 42.7.4 3.4.1 8.3.0 12.8.0.jre11 From 51477605095f761567f7970402dfbbdcf4f7d88a Mon Sep 17 00:00:00 2001 From: Sergey Beryozkin Date: Fri, 23 Aug 2024 18:59:42 +0100 Subject: [PATCH 04/17] Fix OIDC Discord provider configuration (cherry picked from commit dba57b9c62756fc74e01e7497f66b9e666ccdd98) --- .../io/quarkus/oidc/runtime/providers/KnownOidcProviders.java | 3 +++ .../java/io/quarkus/oidc/runtime/KnownOidcProvidersTest.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/providers/KnownOidcProviders.java b/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/providers/KnownOidcProviders.java index 36bc6425e2e49..a87f909dbbef2 100644 --- a/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/providers/KnownOidcProviders.java +++ b/extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/providers/KnownOidcProviders.java @@ -191,14 +191,17 @@ private static OidcTenantConfig twitch() { private static OidcTenantConfig discord() { // Ref https://discord.com/developers/docs/topics/oauth2 OidcTenantConfig ret = new OidcTenantConfig(); + ret.setApplicationType(OidcTenantConfig.ApplicationType.WEB_APP); ret.setAuthServerUrl("https://discord.com/api/oauth2"); ret.setDiscoveryEnabled(false); ret.setAuthorizationPath("authorize"); ret.setTokenPath("token"); + ret.setJwksPath("keys"); ret.getAuthentication().setScopes(List.of("identify", "email")); ret.getAuthentication().setIdTokenRequired(false); ret.getToken().setVerifyAccessTokenWithUserInfo(true); ret.setUserInfoPath("https://discord.com/api/users/@me"); + return ret; } } diff --git a/extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/KnownOidcProvidersTest.java b/extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/KnownOidcProvidersTest.java index 715fe4a563fe6..fc593643f1395 100644 --- a/extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/KnownOidcProvidersTest.java +++ b/extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/KnownOidcProvidersTest.java @@ -529,10 +529,12 @@ public void testAcceptDiscordProperties() throws Exception { OidcTenantConfig config = OidcUtils.mergeTenantConfig(tenant, KnownOidcProviders.provider(Provider.DISCORD)); assertEquals(OidcUtils.DEFAULT_TENANT_ID, config.getTenantId().get()); + assertEquals(ApplicationType.WEB_APP, config.getApplicationType().get()); assertFalse(config.discoveryEnabled.get()); assertEquals("https://discord.com/api/oauth2", config.getAuthServerUrl().get()); assertEquals("authorize", config.getAuthorizationPath().get()); assertEquals("token", config.getTokenPath().get()); + assertEquals("keys", config.getJwksPath().get()); assertEquals("https://discord.com/api/users/@me", config.getUserInfoPath().get()); assertEquals(List.of("identify", "email"), config.authentication.scopes.get()); assertFalse(config.getAuthentication().idTokenRequired.get()); From c5c28a6601d0bcf8db56612c7fb698c626f28f0a Mon Sep 17 00:00:00 2001 From: Konrad Durnoga Date: Sat, 24 Aug 2024 21:54:43 +0200 Subject: [PATCH 05/17] Fix MQTT dev services always start if there is another connector present (cherry picked from commit 52c19da3b831d79a93c0b88b6c5c5bd8374ca5a5) --- .../mqtt/deployment/MqttDevServicesProcessor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/smallrye-reactive-messaging-mqtt/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/mqtt/deployment/MqttDevServicesProcessor.java b/extensions/smallrye-reactive-messaging-mqtt/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/mqtt/deployment/MqttDevServicesProcessor.java index 99d3ae13e1dd3..332ebe9ebddc5 100644 --- a/extensions/smallrye-reactive-messaging-mqtt/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/mqtt/deployment/MqttDevServicesProcessor.java +++ b/extensions/smallrye-reactive-messaging-mqtt/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/mqtt/deployment/MqttDevServicesProcessor.java @@ -203,14 +203,13 @@ private boolean hasMqttChannelWithoutHostAndPort() { boolean isIncoming = name.startsWith("mp.messaging.incoming."); boolean isOutgoing = name.startsWith("mp.messaging.outgoing."); boolean isConnector = name.endsWith(".connector"); - boolean isConfigured; if ((isIncoming || isOutgoing) && isConnector) { String connectorValue = config.getValue(name, String.class); boolean isMqtt = connectorValue.equalsIgnoreCase("smallrye-mqtt"); boolean hasHost = ConfigUtils.isPropertyNonEmpty(name.replace(".connector", ".host")); boolean hasPort = ConfigUtils.isPropertyNonEmpty(name.replace(".connector", ".port")); - isConfigured = isMqtt && (hasHost || hasPort); - if (!isConfigured) { + boolean isConfigured = hasHost || hasPort; + if (isMqtt && !isConfigured) { return true; } } From f418781d7c8c51c9f00acc845dc94a7aed186856 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Fri, 23 Aug 2024 09:41:27 +0200 Subject: [PATCH 06/17] Bump mssql-jdbc to 12.8.1 (cherry picked from commit 7b5ffffa3eaa94b26975dc51e2fe64b309cfa571) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 134da8f1297c5..36c95bf899120 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -123,7 +123,7 @@ 42.7.4 3.4.1 8.3.0 - 12.8.0.jre11 + 12.8.1.jre11 1.6.7 23.5.0.24.07 10.16.1.1 From b6b0323afcad8d71a9bab7ec6d81c2a7c727fad8 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Mon, 26 Aug 2024 09:36:58 +0200 Subject: [PATCH 07/17] TLS - Prevent Duplicate Entries in .env File Previously, when generating local certificates, running the command multiple times could result in duplicate lines being written to the `.env` file. This commit resolves the issue by implementing the same mechanism used in the Let's Encrypt commands, ensuring that duplicate entries are avoided. (cherry picked from commit 1aa95087765aad0c0e1c91bfe2158afa2b12cc9b) --- .../java/io/quarkus/tls/cli/DotEnvHelper.java | 48 +++++++++++++++++++ .../tls/cli/GenerateCertificateCommand.java | 22 ++++----- .../LetsEncryptPrepareCommand.java | 36 ++------------ 3 files changed, 64 insertions(+), 42 deletions(-) create mode 100644 extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/DotEnvHelper.java diff --git a/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/DotEnvHelper.java b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/DotEnvHelper.java new file mode 100644 index 0000000000000..5c6b06c385af9 --- /dev/null +++ b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/DotEnvHelper.java @@ -0,0 +1,48 @@ +package io.quarkus.tls.cli; + +import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.DOT_ENV_FILE; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; + +public class DotEnvHelper { + + private DotEnvHelper() { + // Avoid direct instantiation + } + + public static List readDotEnvFile() throws IOException { + if (!DOT_ENV_FILE.exists()) { + return new ArrayList<>(); + } + return new ArrayList<>(Files.readAllLines(DOT_ENV_FILE.toPath())); + } + + public static void addOrReplaceProperty(List content, String key, String value) { + var line = hasLine(content, key); + if (line != -1) { + content.set(line, key + "=" + value); + } else { + content.add(key + "=" + value); + } + } + + private static int hasLine(List content, String key) { + for (int i = 0; i < content.size(); i++) { + if (content.get(i).startsWith(key + "=") || content.get(i).startsWith(key + " =")) { + return i; + } + } + return -1; + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + public static void deleteQuietly(File file) { + if (file.isFile()) { + file.delete(); + } + } +} diff --git a/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/GenerateCertificateCommand.java b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/GenerateCertificateCommand.java index f570fd8345939..b45fb7e4dbb8b 100644 --- a/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/GenerateCertificateCommand.java +++ b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/GenerateCertificateCommand.java @@ -2,6 +2,9 @@ import static io.quarkus.tls.cli.Constants.CA_FILE; import static io.quarkus.tls.cli.Constants.PK_FILE; +import static io.quarkus.tls.cli.DotEnvHelper.addOrReplaceProperty; +import static io.quarkus.tls.cli.DotEnvHelper.readDotEnvFile; +import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.DOT_ENV_FILE; import static java.lang.System.Logger.Level.ERROR; import static java.lang.System.Logger.Level.INFO; @@ -9,14 +12,15 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileReader; -import java.io.FileWriter; import java.io.IOException; +import java.nio.file.Files; import java.security.KeyPair; import java.security.PrivateKey; import java.security.Security; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.time.Duration; +import java.util.List; import java.util.concurrent.Callable; import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; @@ -105,17 +109,13 @@ private void printConfig(String path, String password) { path = path.replace("\\", "\\\\"); } - // .env format - String env = String.format(""" - _DEV_QUARKUS_TLS_KEY_STORE_P12_PATH=%s - _DEV_QUARKUS_TLS_KEY_STORE_P12_PASSWORD=%s - """, path, password); - - var dotEnvFile = new File(".env"); - try (var writer = new FileWriter(dotEnvFile, dotEnvFile.isFile())) { - writer.write(env); + try { + List dotEnvContent = readDotEnvFile(); + addOrReplaceProperty(dotEnvContent, "%dev.quarkus.tls.key-store.p12.path", path); + addOrReplaceProperty(dotEnvContent, "%dev.quarkus.tls.key-store.p12.password", password); + Files.write(DOT_ENV_FILE.toPath(), dotEnvContent); } catch (IOException e) { - LOGGER.log(ERROR, "Failed to write to .env file", e); + LOGGER.log(ERROR, "Failed to read .env file", e); } LOGGER.log(INFO, """ diff --git a/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/letsencrypt/LetsEncryptPrepareCommand.java b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/letsencrypt/LetsEncryptPrepareCommand.java index b6fa4a34050dd..cea61fdd90396 100644 --- a/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/letsencrypt/LetsEncryptPrepareCommand.java +++ b/extensions/tls-registry/cli/src/main/java/io/quarkus/tls/cli/letsencrypt/LetsEncryptPrepareCommand.java @@ -1,15 +1,16 @@ package io.quarkus.tls.cli.letsencrypt; -import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.*; +import static io.quarkus.tls.cli.DotEnvHelper.addOrReplaceProperty; +import static io.quarkus.tls.cli.DotEnvHelper.deleteQuietly; +import static io.quarkus.tls.cli.DotEnvHelper.readDotEnvFile; +import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.CA_FILE; import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.CERT_FILE; import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.DOT_ENV_FILE; import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.KEY_FILE; import static io.quarkus.tls.cli.letsencrypt.LetsEncryptConstants.LETS_ENCRYPT_DIR; -import java.io.IOException; import java.nio.file.Files; import java.time.Duration; -import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; @@ -72,9 +73,7 @@ public Integer call() throws Exception { } // Delete the CA file, we do not use it. - if (CA_FILE.isFile()) { - CA_FILE.delete(); - } + deleteQuietly(CA_FILE); // Step 3 - Create .env file or append if exists List dotEnvContent = readDotEnvFile(); @@ -97,29 +96,4 @@ public Integer call() throws Exception { return 0; } - List readDotEnvFile() throws IOException { - if (!DOT_ENV_FILE.exists()) { - return new ArrayList<>(); - } - return new ArrayList<>(Files.readAllLines(DOT_ENV_FILE.toPath())); - } - - void addOrReplaceProperty(List content, String key, String value) { - var line = hasLine(content, key); - if (line != -1) { - content.set(line, key + "=" + value); - } else { - content.add(key + "=" + value); - } - } - - private int hasLine(List content, String key) { - for (int i = 0; i < content.size(); i++) { - if (content.get(i).startsWith(key + "=") || content.get(i).startsWith(key + " =")) { - return i; - } - } - return -1; - } - } From 92d25ceec4d53cd05e26697ec73bda59291a0d84 Mon Sep 17 00:00:00 2001 From: franz1981 Date: Mon, 26 Aug 2024 13:49:54 +0200 Subject: [PATCH 08/17] Allocates a single OperationIdStrategy converter (cherry picked from commit 11ee47653d72a3996d5345e5500c0806cec2488f) --- .../smallrye/openapi/runtime/OpenApiConfigMapping.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java b/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java index dc1daf5a538ff..d47462caa5846 100644 --- a/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java +++ b/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiConfigMapping.java @@ -20,7 +20,8 @@ */ public class OpenApiConfigMapping extends RelocateConfigSourceInterceptor { private static final Map RELOCATIONS = relocations(); - private final Converter enumConverter = Converters.getImplicitConverter(OperationIdStrategy.class); + private static final Converter OPERATION_ID_STRATEGY_CONVERTER = Converters + .getImplicitConverter(OperationIdStrategy.class); public OpenApiConfigMapping() { super(RELOCATIONS); @@ -33,7 +34,7 @@ public ConfigValue getValue(ConfigSourceInterceptorContext context, String name) // Special case for enum. The converter run after the interceptors, so we have to do this here. if (name.equals(io.smallrye.openapi.api.constants.OpenApiConstants.OPERATION_ID_STRAGEGY)) { if (configValue != null) { - String correctValue = enumConverter.convert(configValue.getValue()).toString(); + String correctValue = OPERATION_ID_STRATEGY_CONVERTER.convert(configValue.getValue()).toString(); configValue = configValue.withValue(correctValue); } } From 76eaa91442c0cdadcdbbf67aa8f7d19a602e1d4b Mon Sep 17 00:00:00 2001 From: franz1981 Date: Mon, 26 Aug 2024 15:13:56 +0200 Subject: [PATCH 09/17] Save Objects::hash varargs array allocation on JarResource::hashCode (cherry picked from commit 9252585b860bf58717e36c862d3878deaeae451f) --- .../main/java/io/quarkus/bootstrap/runner/JarResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java index 84ae3b69246a2..133093a6a8f1d 100644 --- a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java +++ b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java @@ -185,6 +185,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(manifestInfo, jarPath); + int result = Objects.hashCode(manifestInfo); + result = 31 * result + Objects.hashCode(jarPath); + return result; } } From 4f554acc8226a0bd07405a9a7b1414d75ec65598 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 26 Aug 2024 17:50:49 +0200 Subject: [PATCH 10/17] No need to consider ManifestInfo in equals/hashCode of JarResource (cherry picked from commit 3a1ac4b186dcb7c1207af645e33f1212b2bcbdcf) --- .../main/java/io/quarkus/bootstrap/runner/JarResource.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java index 133093a6a8f1d..2f56ebfab104b 100644 --- a/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java +++ b/independent-projects/bootstrap/runner/src/main/java/io/quarkus/bootstrap/runner/JarResource.java @@ -180,13 +180,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; JarResource that = (JarResource) o; - return Objects.equals(manifestInfo, that.manifestInfo) && jarPath.equals(that.jarPath); + return jarPath.equals(that.jarPath); } @Override public int hashCode() { - int result = Objects.hashCode(manifestInfo); - result = 31 * result + Objects.hashCode(jarPath); - return result; + return Objects.hashCode(jarPath); } } From 544c350fe1a6d22c7e1f9d6ae4d9f658f51f57a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Ataxexe=20Guimar=C3=A3es?= Date: Wed, 21 Aug 2024 12:12:27 +0200 Subject: [PATCH 11/17] Add socket timeout config for the hotrod client (cherry picked from commit 8a163140cc3bba3ea92966539f97409be133d166) --- .../client/deployment/InfinispanConfigurationSetupTest.java | 1 + .../src/test/resources/cache-config-application.properties | 1 + .../infinispan/client/runtime/InfinispanClientProducer.java | 4 ++++ .../client/runtime/InfinispanClientRuntimeConfig.java | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/extensions/infinispan-client/deployment/src/test/java/org/quarkus/infinispan/client/deployment/InfinispanConfigurationSetupTest.java b/extensions/infinispan-client/deployment/src/test/java/org/quarkus/infinispan/client/deployment/InfinispanConfigurationSetupTest.java index 53f90e5ad105e..b5051f83b5c94 100644 --- a/extensions/infinispan-client/deployment/src/test/java/org/quarkus/infinispan/client/deployment/InfinispanConfigurationSetupTest.java +++ b/extensions/infinispan-client/deployment/src/test/java/org/quarkus/infinispan/client/deployment/InfinispanConfigurationSetupTest.java @@ -45,6 +45,7 @@ public void infinispanConnectionConfiguration() { assertThat(configuration.security().ssl().ciphers()).containsExactlyInAnyOrder("SSL_cipher1", "SSL_cipher2"); assertThat(configuration.security().ssl().hostnameValidation()).isTrue(); assertThat(configuration.security().ssl().sniHostName()).isEqualTo("sniHostName"); + assertThat(configuration.socketTimeout()).isEqualTo(10000); assertThat(configuration.clusters()).extracting("clusterName", "clientIntelligence") .containsExactly(tuple("bsite", ClientIntelligence.BASIC)); assertThat(configuration.clusters()).hasSize(1); diff --git a/extensions/infinispan-client/deployment/src/test/resources/cache-config-application.properties b/extensions/infinispan-client/deployment/src/test/resources/cache-config-application.properties index 2c2add6b4dcea..b0e8b172ad8dd 100644 --- a/extensions/infinispan-client/deployment/src/test/resources/cache-config-application.properties +++ b/extensions/infinispan-client/deployment/src/test/resources/cache-config-application.properties @@ -18,6 +18,7 @@ quarkus.infinispan-client.ssl-protocol=SSL_protocol quarkus.infinispan-client.ssl-ciphers=SSL_cipher1,SSL_cipher2 quarkus.infinispan-client.ssl-host-name-validation=true quarkus.infinispan-client.sni-host-name=sniHostName +quarkus.infinispan-client.socket-timeout=10000 quarkus.infinispan-client.backup-cluster.bsite.hosts=bsite1:32111 quarkus.infinispan-client.backup-cluster.bsite.client-intelligence=BASIC diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java index 11ba2d4c1d708..068a67d97bd64 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java @@ -273,6 +273,10 @@ private ConfigurationBuilder builderFromProperties(String infinispanClientName, properties.put(ConfigurationProperties.SNI_HOST_NAME, infinispanClientRuntimeConfig.sniHostName.get()); } + if (infinispanClientRuntimeConfig.socketTimeout.isPresent()) { + properties.put(ConfigurationProperties.SO_TIMEOUT, infinispanClientRuntimeConfig.socketTimeout.get()); + } + builder.withProperties(properties); if (infinispanClientRuntimeConfig.tracingPropagationEnabled.isPresent()) { diff --git a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientRuntimeConfig.java b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientRuntimeConfig.java index 0c8db06302226..0699cb40a142a 100644 --- a/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientRuntimeConfig.java +++ b/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientRuntimeConfig.java @@ -179,6 +179,12 @@ public class InfinispanClientRuntimeConfig { @ConfigItem Optional sniHostName; + /** + * Configures the socket timeout. + */ + @ConfigItem + Optional socketTimeout; + /** * Whether a tracing propagation is enabled in case the Opentelemetry extension is present. * By default the propagation of the context is propagated from the client to the Infinispan Server. From 2f01c66a775599110c96ec24cbd1c71982ba8417 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 26 Aug 2024 11:36:02 +0300 Subject: [PATCH 12/17] Register resource classes for reflection when ContainerResponseFilter exists This is needed because those filters can call setEntityStream which then forces the use of the slow path for calling writers Closes: #42537 (cherry picked from commit 2a050f7db0fb52282d715fe444ea17ce0fb204bd) --- .../deployment/ResteasyReactiveProcessor.java | 8 ++++++ .../common/model/InterceptorContainer.java | 4 +++ ...ityStreamSettingContainerResponseFilter.kt | 28 +++++++++++++++++++ .../kotlin/ReactiveGreetingResource.kt | 2 +- .../kotlin/ReactiveGreetingResourceTest.kt | 4 ++- 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/EntityStreamSettingContainerResponseFilter.kt diff --git a/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java index ba6ec3f69909e..5bab72e60b644 100644 --- a/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java @@ -1078,6 +1078,7 @@ public void additionalReflection(BeanArchiveIndexBuildItem beanArchiveIndexBuild SetupEndpointsResultBuildItem setupEndpointsResult, List messageBodyReaderBuildItems, List messageBodyWriterBuildItems, + ResourceInterceptorsBuildItem resourceInterceptorsBuildItem, BuildProducer producer) { List resourceClasses = setupEndpointsResult.getResourceClasses(); IndexView index = beanArchiveIndexBuildItem.getIndex(); @@ -1122,6 +1123,13 @@ public void additionalReflection(BeanArchiveIndexBuildItem beanArchiveIndexBuild } } } + + // when a ContainerResponseFilter exists, it can potentially do responseContext.setEntityStream() + // which then forces the use of the slow path for calling writers + if (!resourceInterceptorsBuildItem.getResourceInterceptors().getContainerResponseFilters().isEmpty()) { + serializersRequireResourceReflection = true; + } + if (serializersRequireResourceReflection) { producer.produce(ReflectiveClassBuildItem .builder(resourceClasses.stream().map(ResourceClass::getClassName).toArray(String[]::new)) diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/InterceptorContainer.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/InterceptorContainer.java index b6d52e624ed96..075e8e1729148 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/InterceptorContainer.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/model/InterceptorContainer.java @@ -33,6 +33,10 @@ public void sort() { Collections.sort(nameResourceInterceptors); } + public boolean isEmpty() { + return globalResourceInterceptors.isEmpty() && nameResourceInterceptors.isEmpty(); + } + public ResourceInterceptor create() { return new ResourceInterceptor<>(); } diff --git a/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/EntityStreamSettingContainerResponseFilter.kt b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/EntityStreamSettingContainerResponseFilter.kt new file mode 100644 index 0000000000000..c39a20d992e0f --- /dev/null +++ b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/EntityStreamSettingContainerResponseFilter.kt @@ -0,0 +1,28 @@ +package io.quarkus.it.resteasy.reactive.kotlin + +import jakarta.ws.rs.container.ContainerRequestContext +import jakarta.ws.rs.container.ContainerResponseContext +import jakarta.ws.rs.container.ContainerResponseFilter +import jakarta.ws.rs.ext.Provider +import java.io.ByteArrayInputStream +import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveContainerRequestContext + +@Provider +class EntityStreamSettingContainerResponseFilter : ContainerResponseFilter { + override fun filter( + requestContext: ContainerRequestContext?, + responseContext: ContainerResponseContext? + ) { + if (requestContext is ResteasyReactiveContainerRequestContext) { + if ( + "hello".equals( + requestContext.serverRequestContext.resteasyReactiveResourceInfo.name + ) + ) { + responseContext?.setEntity( + ByteArrayInputStream("Hello Quarkus REST".toByteArray(Charsets.UTF_8)) + ) + } + } + } +} diff --git a/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResource.kt b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResource.kt index 37aa578a98faa..96915bbf3cbfd 100644 --- a/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResource.kt +++ b/integration-tests/resteasy-reactive-kotlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResource.kt @@ -30,7 +30,7 @@ class ReactiveGreetingResource @Inject constructor(val req: RequestScopedKotlinC @GET @Produces(MediaType.TEXT_PLAIN) @Path("/{name}") - suspend fun hello(name: String): String { + suspend fun namedHello(name: String): String { delay(50) return "Hello $name" } diff --git a/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResourceTest.kt b/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResourceTest.kt index a2bad8227df38..3c965bacfd132 100644 --- a/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResourceTest.kt +++ b/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveGreetingResourceTest.kt @@ -19,7 +19,9 @@ class ReactiveGreetingResourceTest { When { get("/hello-resteasy-reactive/") } Then { statusCode(200) - body(`is`("Hello RestEASY Reactive")) + body( + `is`("Hello Quarkus REST") + ) // the result comes from EntityStreamSettingContainerResponseFilter } } From 87e71dfecedbd40635d2ae19ff510102ef458bcc Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Tue, 27 Aug 2024 13:03:59 +0300 Subject: [PATCH 13/17] fix: false error message on cli plug with flags (cherry picked from commit 14b98e3e5f572f1b8730185f8ba4ce973c9d7dc2) --- devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java b/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java index a618a7ae3273e..c39ea351ecbcc 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java @@ -12,6 +12,7 @@ import java.util.Optional; import java.util.concurrent.Callable; import java.util.function.Supplier; +import java.util.regex.Pattern; import java.util.stream.Collectors; import jakarta.inject.Inject; @@ -176,7 +177,8 @@ public Optional checkMissingCommand(CommandLine root, String[] args) { .collect(Collectors.toList()); if (!unmatchedSubcommands.isEmpty()) { missingCommand.append("-").append(unmatchedSubcommands.get(0)); - return Optional.of(missingCommand.toString()); + // We don't want the root itself to be added to the result + return Optional.of(missingCommand.toString().replaceFirst(Pattern.quote(root.getCommandName() + "-"), "")); } currentParseResult = currentParseResult.subcommand(); From 6fb7703189f0bf80b09b243909982742186d1745 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 27 Aug 2024 13:49:45 +0200 Subject: [PATCH 14/17] Avoid using a dynamic regexp (cherry picked from commit 732518893a3981fedc7414fb1f7bcea501210b1c) --- .../cli/src/main/java/io/quarkus/cli/QuarkusCli.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java b/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java index c39ea351ecbcc..ef9ad75138415 100644 --- a/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java +++ b/devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java @@ -12,7 +12,6 @@ import java.util.Optional; import java.util.concurrent.Callable; import java.util.function.Supplier; -import java.util.regex.Pattern; import java.util.stream.Collectors; import jakarta.inject.Inject; @@ -178,7 +177,7 @@ public Optional checkMissingCommand(CommandLine root, String[] args) { if (!unmatchedSubcommands.isEmpty()) { missingCommand.append("-").append(unmatchedSubcommands.get(0)); // We don't want the root itself to be added to the result - return Optional.of(missingCommand.toString().replaceFirst(Pattern.quote(root.getCommandName() + "-"), "")); + return Optional.of(stripRootPrefix(missingCommand.toString(), root.getCommandName() + "-")); } currentParseResult = currentParseResult.subcommand(); @@ -195,6 +194,14 @@ public Optional checkMissingCommand(CommandLine root, String[] args) { } } + private static String stripRootPrefix(String command, String rootPrefix) { + if (!command.startsWith(rootPrefix)) { + return command; + } + + return command.substring(rootPrefix.length()); + } + @Override public Integer call() throws Exception { output.info("%n@|bold Quarkus CLI|@ version %s", Version.clientVersion()); From e079ab05d5776796ba058c801c2665879c3a3065 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 27 Aug 2024 16:13:16 +0200 Subject: [PATCH 15/17] Revert "Adding new WithTesResource annotation" This reverts commit 571740884320489d6d68286758c15cffea54613f. Revert "Removed missed deprecated `@QuarkusTestResource` from docs" This reverts commit 6588ea3bf193b68c41faae61a454cac773775870. And more as it was more involved than that, since some tests were removed, modified, added since then. --- .../org/acme/MyMessagingApplicationTest.java | 2 +- docs/src/main/asciidoc/datasource.adoc | 8 ++--- .../asciidoc/getting-started-testing.adoc | 32 +++++++++---------- .../asciidoc/kafka-schema-registry-avro.adoc | 4 +-- .../kafka-schema-registry-json-schema.adoc | 4 +-- docs/src/main/asciidoc/kafka.adoc | 12 +++---- docs/src/main/asciidoc/kubernetes-client.adoc | 6 ++-- docs/src/main/asciidoc/messaging.adoc | 4 +-- docs/src/main/asciidoc/mongodb.adoc | 4 +-- docs/src/main/asciidoc/native-and-ssl.adoc | 2 +- .../observability-devservices-lgtm.adoc | 4 +-- .../asciidoc/observability-devservices.adoc | 2 +- docs/src/main/asciidoc/rest-client.adoc | 11 +++++-- docs/src/main/asciidoc/resteasy-client.adoc | 4 +-- docs/src/main/asciidoc/security-oauth2.adoc | 15 ++++++--- ...rity-oidc-bearer-token-authentication.adoc | 8 ++--- ...ecurity-oidc-code-flow-authentication.adoc | 10 +++--- .../io/quarkus/agroal/test/TestResources.java | 4 +-- .../elytron/security/ldap/CacheTest.java | 4 +-- .../security/ldap/LdapSecurityRealmTest.java | 4 +-- .../security/ldap/SearchRecursiveTest.java | 4 +-- .../flyway/test/FlywayTestResources.java | 4 +-- .../test/LiquibaseTestResources.java | 4 +-- .../NamedOidcClientFilterDevModeTest.java | 4 +-- .../filter/OidcClientFilterDevModeTest.java | 4 +-- .../GraphQLClientUsingOidcClientTest.java | 4 +-- .../NamedOidcClientFilterDevModeTest.java | 4 +-- .../NamedOidcClientInjectionTestCase.java | 4 +-- ...CredentialsJwtPrivateKeyStoreTestCase.java | 4 +-- ...lientCredentialsJwtPrivateKeyTestCase.java | 4 +-- ...idcClientCredentialsJwtSecretTestCase.java | 4 +-- .../client/OidcClientCredentialsTestCase.java | 4 +-- ...lientUserPasswordCustomFilterTestCase.java | 4 +-- .../OidcClientUserPasswordTestCase.java | 4 +-- .../reactive/AccessTokenAnnotationTest.java | 4 +-- .../reactive/OidcTokenPropagationTest.java | 4 +-- ...SecurityIdentityAugmentorLazyAuthTest.java | 4 +-- ...tionWithSecurityIdentityAugmentorTest.java | 4 +-- .../AccessTokenAnnotationTest.java | 4 +-- .../propagation/OidcTokenPropagationTest.java | 4 +-- ...SecurityIdentityAugmentorLazyAuthTest.java | 4 +-- ...tionWithSecurityIdentityAugmentorTest.java | 4 +-- .../CodeFlowDevModeDefaultTenantTestCase.java | 4 +-- .../oidc/test/CodeFlowDevModeTestCase.java | 4 +-- ...odeFlowRuntimeCredentialsProviderTest.java | 4 +-- ...CodeFlowVerifyAccessTokenDisabledTest.java | 4 +-- ...VerifyInjectedAccessTokenDisabledTest.java | 4 +-- .../CodeTenantReauthenticateTestCase.java | 4 +-- .../test/CustomIdentityProviderTestCase.java | 4 +-- ...BasicAuthAndBearerAuthCombinationTest.java | 4 +-- ...sicAuthAndCodeFlowAuthCombinationTest.java | 4 +-- .../test/UserInfoRequiredDetectionTest.java | 4 +-- .../common/MongoDatabaseResolverTest.java | 4 +-- .../redis/deployment/NamedRedisCacheTest.java | 4 +-- .../client/ClientInjectionTest.java | 4 +-- .../deployment/client/CustomizerTest.java | 4 +-- .../client/datasource/CustomCodecTest.java | 4 +-- .../datasource/DataSourceInjectionTest.java | 4 +-- .../client/datasource/DataSourceTest.java | 4 +-- .../devmode/RedisClientDevModeTestCase.java | 4 +-- .../RedisClientPreloadDevModeTestCase.java | 4 +-- .../client/patterns/BinaryTest.java | 4 +-- .../deployment/client/patterns/CacheTest.java | 4 +-- .../client/patterns/CounterTest.java | 4 +-- .../client/patterns/PubSubOnStartupTest.java | 4 +-- .../client/patterns/PubSubTest.java | 4 +-- ...ultFileForDefaultClientPreloadingTest.java | 4 +-- .../preloading/MissingFilePreloadTest.java | 4 +-- .../MultiClientImportPreloadingTest.java | 4 +-- ...lientImportPreloadingWithFlushAllTest.java | 4 +-- ...ntImportPreloadingWithOnlyIfEmptyTest.java | 4 +-- ...sForDefaultClientImportPreloadingTest.java | 4 +-- ...eForDefaultClientImportPreloadingTest.java | 4 +-- .../io/quarkus/it/cache/TreeTestCase.java | 4 +-- ...e_quark_us_MyMessagingApplicationTest.java | 2 +- ...e_quark_us_MyMessagingApplicationTest.java | 2 +- .../it/ElytronJdbcExtensionTestResources.java | 4 +-- .../it/ElytronLdapExtensionTestResources.java | 4 +-- .../java/org/acme/ExampleResourceTest.java | 18 +++++------ .../java/org/acme/ExampleResourceTest.java | 18 +++++------ .../example/grpc/hibernate/TestResources.java | 4 +-- .../io/quarkus/it/envers/TestResources.java | 4 +-- .../orm/graphql/panache/TestResources.java | 4 +-- .../io/quarkus/it/panache/TestResources.kt | 5 ++- .../it/panache/defaultpu/TestResources.java | 4 +-- .../orm/rest/data/panache/TestResources.java | 4 +-- .../outboxpolling/TestResources.java | 4 +-- .../orm/elasticsearch/TestResources.java | 4 +-- .../search/orm/opensearch/TestResources.java | 4 +-- .../HibernateValidatorFunctionalityTest.java | 4 +-- .../HibernateValidatorFunctionalityTest.java | 6 ++-- .../infinispan/cache/jpa/TestResources.java | 4 +-- .../jpa/db2/HibernateOrmNoWarningsTest.java | 4 +-- .../jpa/derby/HibernateOrmNoWarningsTest.java | 4 +-- .../quarkus/it/jpa/derby/TestResources.java | 4 +-- .../it/jpa/h2/HibernateOrmNoWarningsTest.java | 4 +-- .../it/jpa/h2/HibernateOrmNoWarningsTest.java | 4 +-- .../mariadb/HibernateOrmNoWarningsTest.java | 4 +-- .../jpa/mssql/HibernateOrmNoWarningsTest.java | 4 +-- .../jpa/mysql/HibernateOrmNoWarningsTest.java | 4 +-- .../oracle/HibernateOrmNoWarningsTest.java | 4 +-- .../HibernateOrmNoWarningsTest.java | 4 +-- .../jpa/configurationless/TestResources.java | 4 +-- .../java/io/quarkus/it/kafka/KafkaAvroIT.java | 4 +-- .../quarkus/it/kafka/KafkaJsonSchemaIT.java | 4 +-- .../io/quarkus/it/kafka/KafkaOauthIT.java | 4 +-- .../io/quarkus/it/kafka/KafkaOauthTest.java | 4 +-- .../java/io/quarkus/it/kafka/KafkaSaslIT.java | 4 +-- .../io/quarkus/it/kafka/KafkaSaslTest.java | 4 +-- .../quarkus/it/kafka/SaslKafkaConsumerIT.java | 4 +-- .../it/kafka/SaslKafkaConsumerTest.java | 4 +-- .../it/kafka/KafkaSnappyCodecTest.java | 4 +-- .../it/kafka/KafkaSnappyConsumerTest.java | 4 +-- .../it/kafka/SslJksKafkaConsumerITCase.java | 6 ++-- .../it/kafka/SslJksKafkaConsumerTest.java | 6 ++-- .../kafka/SslPKCS12KafkaConsumerITCase.java | 6 ++-- .../it/kafka/SslPKCS12KafkaConsumerTest.java | 6 ++-- .../it/kafka/SslPemKafkaConsumerITCase.java | 6 ++-- .../it/kafka/SslPemKafkaConsumerTest.java | 6 ++-- .../streams/KafkaStreamsCdiEventTest.java | 4 +-- .../streams/KafkaStreamsPropertiesTest.java | 4 +-- .../KafkaStreamsStartupFailureTest.java | 4 +-- .../it/kafka/streams/KafkaStreamsTest.java | 4 +-- .../io/quarkus/it/kafka/KafkaCodecTest.java | 4 +-- .../quarkus/it/kafka/KafkaConsumerTest.java | 4 +-- .../quarkus/it/kafka/KafkaProducerTest.java | 4 +-- ...DynamicTenantConfigPolicyEnforcerTest.java | 4 +-- .../StaticTenantConfigPolicyEnforcerTest.java | 4 +-- .../client/AbsentConfigMapPropertiesPMT.java | 4 +-- .../client/ConfigMapPropertiesTest.java | 4 +-- .../client/KubernetesClientTest.java | 4 +-- .../client/KubernetesNewClientTest.java | 4 +-- .../NamespacedConfigMapPropertiesTest.java | 4 +-- .../client/SecretPropertiesTest.java | 4 +-- .../liquibase/mongodb/FruitResourceTest.java | 4 +-- .../mongodb/NativeFruitResourceTestIT.java | 4 +-- .../it/liquibase/LiquibaseTestResources.java | 4 +-- .../minlevel/set/LoggingFilterTest.java | 4 +-- .../set/LoggingMinLevelAboveTest.java | 4 +-- .../set/LoggingMinLevelBelowChildTest.java | 4 +-- .../set/LoggingMinLevelBelowTest.java | 4 +-- .../set/LoggingMinLevelByDefaultTest.java | 4 +-- .../set/LoggingMinLevelPromoteSubTest.java | 4 +-- .../set/LoggingMinLevelPromoteTest.java | 4 +-- .../unset/LoggingMinLevelAboveTest.java | 4 +-- .../unset/LoggingMinLevelByDefaultTest.java | 4 +-- .../unset/LoggingMinLevelGlobalTest.java | 4 +-- .../unset/LoggingMinLevelPromoteTest.java | 4 +-- .../java/io/quarkus/it/mailer/MailerIT.java | 4 +-- .../java/io/quarkus/it/mailer/MailerTest.java | 6 ++-- .../GetExceptionsInTestResourceTestCase.java | 4 +-- ...uarkusTestNestedWithResourcesTestCase.java | 4 +-- .../io/quarkus/it/main/TestResources.java | 4 +-- .../micrometer/prometheus/TestResources.java | 4 +-- .../quarkus/it/mongodb/BookResourceTest.java | 4 +-- .../panache/MongodbPanacheResourceTest.kt | 4 +-- .../ReactiveMongodbPanacheResourceTest.kt | 4 +-- .../mongodb/panache/MongoTestResources.java | 4 +-- .../panache/MongoDbRestDataPanacheTest.java | 4 +-- .../observability/test/LgtmLifecycleTest.java | 4 +-- .../quarkus/it/keycloak/OidcClientTest.java | 4 +-- .../quarkus/it/keycloak/OidcClientTest.java | 4 +-- .../io/quarkus/it/keycloak/CodeFlowTest.java | 4 +-- .../BearerTokenAuthorizationTest.java | 4 +-- .../TestSecurityCombiningAuthMechTest.java | 4 +-- .../it/keycloak/OidcTokenPropagationTest.java | 6 ++-- .../keycloak/AnnotationBasedTenantTest.java | 4 +-- .../BearerOpaqueTokenAuthorizationTest.java | 4 +-- .../BearerTokenAuthorizationTest.java | 4 +-- .../keycloak/CodeFlowAuthorizationTest.java | 4 +-- .../BearerTokenAuthorizationTest.java | 4 +-- .../it/keycloak/WebsocketOidcTestCase.java | 4 +-- .../openshift/client/OpenShiftClientTest.java | 4 +-- ...2OpenTelemetryJdbcInstrumentationTest.java | 4 +-- ...bOpenTelemetryJdbcInstrumentationTest.java | 4 +-- ...eOpenTelemetryJdbcInstrumentationTest.java | 4 +-- ...sOpenTelemetryJdbcInstrumentationTest.java | 4 +-- .../it/opentelemetry/BookResourceTest.java | 4 +-- .../opentelemetry/OpenTelemetryTestCase.java | 4 +-- .../OpenTelemetryWithSpanAtStartupTest.java | 4 +-- .../grpc/GrpcNoTLSNoCompressionTest.java | 4 +-- .../grpc/GrpcNoTLSWithCompressionTest.java | 4 +-- .../grpc/GrpcWithTLSNoCompressionTest.java | 4 +-- .../grpc/GrpcWithTLSWithCompressionTest.java | 6 ++-- .../http/HttpNoTLSNoCompressionTest.java | 4 +-- .../http/HttpNoTLSWithCompressionTest.java | 6 ++-- .../http/HttpWithTLSNoCompressionTest.java | 6 ++-- .../http/HttpWithTLSWithCompressionTest.java | 6 ++-- ...thTLSWithCompressionUsingRegistryTest.java | 6 ++-- .../io/quarkus/it/picocli/PicocliTest.java | 4 +-- .../io/quarkus/it/quartz/TestResources.java | 4 +-- .../io/quarkus/it/qute/TestResources.java | 4 +-- .../io/quarkus/it/amqp/AmqpConnectorTest.java | 4 +-- .../quarkus/it/kafka/KafkaConnectorTest.java | 4 +-- .../quarkus/it/kafka/KafkaConnectorTest.java | 4 +-- .../quarkus/it/kafka/KafkaConnectorTest.java | 4 +-- .../it/pulsar/JksPulsarConnectorTest.java | 4 +-- .../it/pulsar/PKCS12PulsarConnectorTest.java | 4 +-- .../it/pulsar/PemPulsarConnectorTest.java | 4 +-- .../it/pulsar/PulsarConnectorTest.java | 4 +-- .../RabbitMQConnectorDynCredsTest.java | 4 +-- .../stork/RestClientReactiveStorkTest.java | 6 ++-- .../ExternalSelfSignedTestCase.java | 6 ++-- .../wronghost/ExternalWrongHostTestCase.java | 6 ++-- .../ExternalSelfSignedTestCase.java | 4 +-- .../trustall/ExternalTlsTrustAllTestCase.java | 6 ++-- ...rongHostUsingHostnameVerifierTestCase.java | 6 ++-- ...ernalWrongHostUsingVerifyHostTestCase.java | 6 ++-- .../reactive/kotlin/ReactiveMessagingTest.kt | 4 +-- .../quarkus/context/test/TestResources.java | 4 +-- .../keycloak/GraphQLAuthExpiryTest.java | 4 +-- .../keycloak/SmallRyeJwtOidcWebAppTest.java | 4 +-- .../it/keycloak/OidcTokenPropagationTest.java | 4 +-- .../SmallRyeJwtGrpcAuthorizationTest.java | 4 +-- .../runtime/CommonAndTestProfilesTest.java | 4 +-- .../client/runtime/OnlyTestProfileTest.java | 4 +-- .../it/spring/data/jpa/TestResources.java | 4 +-- .../it/spring/data/rest/TestResources.java | 4 +-- .../quarkus/it/extension/CustomResource.java | 4 +-- .../it/extension/CustomResourceWithList.java | 6 ++-- .../it/vthreads/amqp/VirtualThreadTest.java | 4 +-- .../it/vthreads/jms/VirtualThreadTest.java | 4 +-- .../it/vthreads/kafka/VirtualThreadTest.java | 4 +-- .../virtual/mail/RunOnVirtualThreadTest.java | 4 +-- .../test/common/QuarkusTestResource.java | 9 ++---- .../QuarkusTestResourceLifecycleManager.java | 4 +-- .../common/QuarkusTestResourceRepeatable.java | 5 --- .../io/quarkus/test/common/ResourceArg.java | 4 +-- .../quarkus/test/common/WithTestResource.java | 6 +++- .../cloud/functions/test/WithFunction.java | 4 +-- .../test/LogCollectingTestResource.java | 2 +- .../test/junit/QuarkusTestProfile.java | 2 +- .../client/WithKubernetesTestServer.java | 4 +-- ...OidcWiremockTestResourceInjectionTest.java | 4 +-- .../client/WithOpenShiftTestServer.java | 4 +-- 235 files changed, 539 insertions(+), 536 deletions(-) diff --git a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/messaging-codestart/java/src/test/java/org/acme/MyMessagingApplicationTest.java b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/messaging-codestart/java/src/test/java/org/acme/MyMessagingApplicationTest.java index ba316899f87f6..26b5971a06b6a 100644 --- a/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/messaging-codestart/java/src/test/java/org/acme/MyMessagingApplicationTest.java +++ b/devtools/project-core-extension-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/messaging-codestart/java/src/test/java/org/acme/MyMessagingApplicationTest.java @@ -1,6 +1,6 @@ package org.acme; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; import io.quarkus.test.junit.QuarkusTest; diff --git a/docs/src/main/asciidoc/datasource.adoc b/docs/src/main/asciidoc/datasource.adoc index 46d9f291a6692..70cfc46a743fa 100644 --- a/docs/src/main/asciidoc/datasource.adoc +++ b/docs/src/main/asciidoc/datasource.adoc @@ -700,8 +700,8 @@ This will allow you to test your application even when it is compiled into a nat . Add the following specific annotation on any class in your integration tests for running integration tests in both JVM or native executables: + -* `@WithTestResource(H2DatabaseTestResource.class)` -* `@WithTestResource(DerbyDatabaseTestResource.class)` +* `@QuarkusTestResource(H2DatabaseTestResource.class)` +* `@QuarkusTestResource(DerbyDatabaseTestResource.class)` + This ensures that the test suite starts and terminates the managed database in a separate process as required for test execution. + @@ -710,10 +710,10 @@ This ensures that the test suite starts and terminates the managed database in a ---- package my.app.integrationtests.db; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(H2DatabaseTestResource.class) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } ---- diff --git a/docs/src/main/asciidoc/getting-started-testing.adoc b/docs/src/main/asciidoc/getting-started-testing.adoc index f7ea25492044f..7495ce2c1144e 100644 --- a/docs/src/main/asciidoc/getting-started-testing.adoc +++ b/docs/src/main/asciidoc/getting-started-testing.adoc @@ -550,7 +550,7 @@ public class MockGreetingProfile implements QuarkusTestProfile { <1> * Additional {@link QuarkusTestResourceLifecycleManager} classes (along with their init params) to be used from this * specific test profile. * - * If this method is not overridden, then only the {@link QuarkusTestResourceLifecycleManager} classes enabled via the {@link io.quarkus.test.common.WithTestResource} class + * If this method is not overridden, then only the {@link QuarkusTestResourceLifecycleManager} classes enabled via the {@link io.quarkus.test.common.QuarkusTestResource} class * annotation will be used for the tests using this profile (which is the same behavior as tests that don't use a profile at all). */ @Override @@ -603,7 +603,7 @@ public class MockGreetingProfile implements QuarkusTestProfile { <1> public boolean disableApplicationLifecycleObservers() { return false; } - + @Produces <2> public ExternalService mockExternalService() { return new ExternalService("mock"); @@ -1086,17 +1086,15 @@ If you are using Quarkus Security, check out the xref:security-testing.adoc[Test [[quarkus-test-resource]] == Starting services before the Quarkus application starts -A very common need is to start some services on which your Quarkus application depends, before the Quarkus application starts for testing. To address this need, Quarkus provides `@io.quarkus.test.common.WithTestResource` and `io.quarkus.test.common.QuarkusTestResourceLifecycleManager`. - -When a test annotated with `@WithTestResource`, Quarkus will run the corresponding `QuarkusTestResourceLifecycleManager` before the test. +A very common need is to start some services on which your Quarkus application depends, before the Quarkus application starts for testing. To address this need, Quarkus provides `@io.quarkus.test.common.QuarkusTestResource` and `io.quarkus.test.common.QuarkusTestResourceLifecycleManager`. -IMPORTANT: By default, `@WithTestResource` applies only to the test on which the annotation is placed. Each test that is annotated with `@WithTestResource` will result in the application being re-augmented and restarted -(in a similar fashion as happens in dev-mode when a change is detected) in order to incorporate the settings configured by the annotation. This means that if there are many instances of the annotation used throughout the testsuite, -test execution speed will be impacted by these restarts. +By simply annotating any test in the test suite with `@QuarkusTestResource`, Quarkus will run the corresponding `QuarkusTestResourceLifecycleManager` before any tests are run. +A test suite is also free to utilize multiple `@QuarkusTestResource` annotations, in which case all the corresponding `QuarkusTestResourceLifecycleManager` objects will be run before the tests. -NOTE: Test resources are applied for a given test class or custom profile. To activate for all tests you can use `@WithTestResource(restrictToAnnotatedClass = false)`. +NOTE: Test resources are global, even if they are defined on a test class or custom profile, which means they will all be activated for all tests, even though we do +remove duplicates. If you want to only enable a test resource on a single test class or test profile, you can use `@QuarkusTestResource(restrictToAnnotatedClass = true)`. -NOTE: When using multiple test resources they can be started concurrently. For that you need to set `@WithTestResource(parallel = true)`. +NOTE: When using multiple test resources, they can be started concurrently. For that you need to set `@QuarkusTestResource(parallel = true)`. Quarkus provides a few implementations of `QuarkusTestResourceLifecycleManager` out of the box (see `io.quarkus.test.h2.H2DatabaseTestResource` which starts an H2 database, or `io.quarkus.test.kubernetes.client.KubernetesServerTestResource` which starts a mock Kubernetes API server), but it is common to create custom implementations to address specific application needs. @@ -1113,7 +1111,7 @@ If for example you have a test like the following: [source,java] ---- @QuarkusTest -@WithTestResource(MyWireMockResource.class) +@QuarkusTestResource(MyWireMockResource.class) public class MyTest { @InjectWireMock // this a custom annotation you are defining in your own application @@ -1164,7 +1162,7 @@ any necessary injections into the test class. === Annotation-based test resources -It is possible to write test resources that are enabled and configured using annotations. This is enabled by placing the `@WithTestResource` +It is possible to write test resources that are enabled and configured using annotations. This is enabled by placing the `@QuarkusTestResource` on an annotation which will be used to enable and configure the test resource. For example, this defines the `@WithKubernetesTestServer` annotation, which you can use on your tests to activate the `KubernetesServerTestResource`, @@ -1172,7 +1170,7 @@ but only for the annotated test class. You can also place them on your `QuarkusT [source,java] ---- -@WithTestResource(KubernetesServerTestResource.class) +@QuarkusTestResource(KubernetesServerTestResource.class) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface WithKubernetesTestServer { @@ -1216,12 +1214,12 @@ public class KubernetesServerTestResource } ---- -If you want to make the annotation repeatable, the containing annotation type must be annotated with `@WithTestResourceRepeatable`. +If you want to make the annotation repeatable, the containing annotation type must be annotated with `@QuarkusTestResourceRepeatable`. For example, this would define a repeatable `@WithRepeatableTestResource` annotation. [source,java] ---- -@WithTestResource(KubernetesServerTestResource.class) +@QuarkusTestResource(KubernetesServerTestResource.class) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Repeatable(WithRepeatableTestResource.List.class) @@ -1231,7 +1229,7 @@ public @interface WithRepeatableTestResource { @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) - @WithTestResourceRepeatable(WithRepeatableTestResource.class) + @QuarkusTestResourceRepeatable(WithRepeatableTestResource.class) @interface List { WithRepeatableTestResource[] value(); } @@ -1416,7 +1414,7 @@ public class CustomResource implements QuarkusTestResourceLifecycleManager, DevS } ---- -`CustomResource` would be activated on a `@QuarkusIntegrationTest` using `@WithTestResource` as is described in the corresponding section of this doc. +`CustomResource` would be activated on a `@QuarkusIntegrationTest` using `@QuarkusTestResource` as is described in the corresponding section of this doc. === Executing against a running application diff --git a/docs/src/main/asciidoc/kafka-schema-registry-avro.adoc b/docs/src/main/asciidoc/kafka-schema-registry-avro.adoc index cabb95f604bae..2800ef99f00b3 100644 --- a/docs/src/main/asciidoc/kafka-schema-registry-avro.adoc +++ b/docs/src/main/asciidoc/kafka-schema-registry-avro.adoc @@ -440,7 +440,7 @@ what we send. ---- package org.acme.kafka; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.http.ContentType; @@ -607,7 +607,7 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi [source,java] ---- @QuarkusTest -@WithTestResource(KafkaAndSchemaRegistryTestResource.class) +@QuarkusTestResource(KafkaAndSchemaRegistryTestResource.class) public class MovieResourceTest { ... } diff --git a/docs/src/main/asciidoc/kafka-schema-registry-json-schema.adoc b/docs/src/main/asciidoc/kafka-schema-registry-json-schema.adoc index e5e5fb99a7539..3ae3a1585b527 100644 --- a/docs/src/main/asciidoc/kafka-schema-registry-json-schema.adoc +++ b/docs/src/main/asciidoc/kafka-schema-registry-json-schema.adoc @@ -468,7 +468,7 @@ what we send. ---- package org.acme.kafka; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.http.ContentType; @@ -635,7 +635,7 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi [source,java] ---- @QuarkusTest -@WithTestResource(KafkaAndSchemaRegistryTestResource.class) +@QuarkusTestResource(KafkaAndSchemaRegistryTestResource.class) public class MovieResourceTest { ... } diff --git a/docs/src/main/asciidoc/kafka.adoc b/docs/src/main/asciidoc/kafka.adoc index 5b64ae38ccb33..0abd8ab7adf6d 100644 --- a/docs/src/main/asciidoc/kafka.adoc +++ b/docs/src/main/asciidoc/kafka.adoc @@ -2236,7 +2236,7 @@ Create a Quarkus Test using the test resource created above: import static org.awaitility.Awaitility.await; @QuarkusTest -@WithTestResource(KafkaTestResourceLifecycleManager.class) +@QuarkusTestResource(KafkaTestResourceLifecycleManager.class) class BaristaTest { @Inject @@ -2295,7 +2295,7 @@ public class BeverageProcessor { import static org.awaitility.Awaitility.await; @QuarkusTest -@WithTestResource(KafkaTestResourceLifecycleManager.class) +@QuarkusTestResource(KafkaTestResourceLifecycleManager.class) class BaristaTest { @Inject @@ -2380,7 +2380,7 @@ For using `KafkaCompanion` API in tests, start by adding the following dependenc which provides `io.quarkus.test.kafka.KafkaCompanionResource` - an implementation of `io.quarkus.test.common.QuarkusTestResourceLifecycleManager`. -Then use `@WithTestResource` to configure the Kafka Companion in tests, for example: +Then use `@QuarkusTestResource` to configure the Kafka Companion in tests, for example: [source, java] ---- @@ -2391,7 +2391,7 @@ import java.util.UUID; import org.apache.kafka.clients.producer.ProducerRecord; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.InjectKafkaCompanion; import io.quarkus.test.kafka.KafkaCompanionResource; @@ -2399,7 +2399,7 @@ import io.smallrye.reactive.messaging.kafka.companion.ConsumerTask; import io.smallrye.reactive.messaging.kafka.companion.KafkaCompanion; @QuarkusTest -@WithTestResource(KafkaCompanionResource.class) +@QuarkusTestResource(KafkaCompanionResource.class) public class OrderProcessorTest { @InjectKafkaCompanion // <1> @@ -2430,7 +2430,7 @@ If the Kafka Dev Service is available during tests, `KafkaCompanionResource` use The configuration of the created Kafka broker can be customized using `@ResourceArg`, for example: [source,java] ---- -@WithTestResource(value = KafkaCompanionResource.class, initArgs = { +@QuarkusTestResource(value = KafkaCompanionResource.class, initArgs = { @ResourceArg(name = "strimzi.kafka.image", value = "quay.io/strimzi-test-container/test-container:0.106.0-kafka-3.7.0"), // Image name @ResourceArg(name = "kafka.port", value = "9092"), // Fixed port for kafka, by default it will be exposed on a random port @ResourceArg(name = "kraft", value = "true"), // Enable Kraft mode diff --git a/docs/src/main/asciidoc/kubernetes-client.adoc b/docs/src/main/asciidoc/kubernetes-client.adoc index e6fdd89305b3d..6fd8a07919a06 100644 --- a/docs/src/main/asciidoc/kubernetes-client.adoc +++ b/docs/src/main/asciidoc/kubernetes-client.adoc @@ -260,7 +260,7 @@ public class MyTest { } ---- -Alternately, you can create an extension of the `KubernetesServerTestResource` class to ensure all your `@QuarkusTest` enabled test classes share the same mock server setup via the `WithTestResource` annotation: +Alternately, you can create an extension of the `KubernetesServerTestResource` class to ensure all your `@QuarkusTest` enabled test classes share the same mock server setup via the `QuarkusTestResource` annotation: [source%nowrap,java] ---- @@ -278,7 +278,7 @@ public class CustomKubernetesMockServerTestResource extends KubernetesServerTest and use this in your other test classes as follows: [source%nowrap,java] ---- -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(CustomKubernetesMockServerTestResource.class) @QuarkusTest public class KubernetesClientTest { @@ -478,7 +478,7 @@ Mock support is also provided in a similar fashion: [source, java] ---- -@WithTestResource(OpenShiftMockServerTestResource.class) +@QuarkusTestResource(OpenShiftMockServerTestResource.class) @QuarkusTest public class OpenShiftClientTest { diff --git a/docs/src/main/asciidoc/messaging.adoc b/docs/src/main/asciidoc/messaging.adoc index e0705c1b8fea1..2361154650bc1 100644 --- a/docs/src/main/asciidoc/messaging.adoc +++ b/docs/src/main/asciidoc/messaging.adoc @@ -703,7 +703,7 @@ Create a `@QuarkusTest` using the test resource created above: [source, java] ---- -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.reactive.messaging.memory.InMemoryConnector; import io.smallrye.reactive.messaging.memory.InMemorySink; @@ -718,7 +718,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.awaitility.Awaitility.await; @QuarkusTest -@WithTestResource(InMemoryConnectorLifecycleManager.class) +@QuarkusTestResource(InMemoryConnectorLifecycleManager.class) class MyMessagingApplicationTest { @Inject diff --git a/docs/src/main/asciidoc/mongodb.adoc b/docs/src/main/asciidoc/mongodb.adoc index 8ba13a1958695..811a332c59d76 100644 --- a/docs/src/main/asciidoc/mongodb.adoc +++ b/docs/src/main/asciidoc/mongodb.adoc @@ -639,14 +639,14 @@ To set the desired port MongoDB will listen to when it is launched, the followin [source,java] ---- -@WithTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.PORT, value = "27017")) +@QuarkusTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.PORT, value = "27017")) ---- To set the desired MongoDB version that will be launched, the following code should be used: [source,java] ---- -@WithTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.VERSION, value = "V5_0")) +@QuarkusTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.VERSION, value = "V5_0")) ---- The string value used can be any of one of the `de.flapdoodle.embed.mongo.distribution.Version` or `de.flapdoodle.embed.mongo.distribution.Version.Main` enums. diff --git a/docs/src/main/asciidoc/native-and-ssl.adoc b/docs/src/main/asciidoc/native-and-ssl.adoc index 4271614a28a94..86e14bf517349 100644 --- a/docs/src/main/asciidoc/native-and-ssl.adoc +++ b/docs/src/main/asciidoc/native-and-ssl.adoc @@ -45,7 +45,7 @@ which configures our REST client to connect to an SSL REST service. For the purposes of this guide, we also need to remove the configuration that starts the embedded WireMock server that stubs REST client responses so the tests actually propagate calls to the https://stage.code.quarkus.io/api. Update the test file `src/test/java/org/acme/rest/client/ExtensionsResourceTest.java` and remove the line: [source,java] ---- -@WithTestResource(WireMockExtensions.class) +@QuarkusTestResource(WireMockExtensions.class) ---- from the `ExtensionsResourceTest` class. diff --git a/docs/src/main/asciidoc/observability-devservices-lgtm.adoc b/docs/src/main/asciidoc/observability-devservices-lgtm.adoc index 64a5a5c29d4dc..b34862ceb865c 100644 --- a/docs/src/main/asciidoc/observability-devservices-lgtm.adoc +++ b/docs/src/main/asciidoc/observability-devservices-lgtm.adoc @@ -118,11 +118,11 @@ And for the least 'auto-magical' usage in the tests, simply disable both (Dev Re quarkus.observability.enabled=false ---- -And then explicitly list LGTM Dev Resource in the test as a `@WithTestResource` resource: +And then explicitly list LGTM Dev Resource in the test as a `@QuarkusTestResource` resource: [source, java] ---- @QuarkusTest -@WithTestResource(LgtmResource.class) +@QuarkusTestResource(value = LgtmResource.class, restrictToAnnotatedClass = true) @TestProfile(QuarkusTestResourceTestProfile.class) public class LgtmLifecycleTest extends LgtmTestBase { } diff --git a/docs/src/main/asciidoc/observability-devservices.adoc b/docs/src/main/asciidoc/observability-devservices.adoc index ebbdfde4bb37a..e906b22741cd6 100644 --- a/docs/src/main/asciidoc/observability-devservices.adoc +++ b/docs/src/main/asciidoc/observability-devservices.adoc @@ -20,7 +20,7 @@ NOTE: Each Dev Resource implementation is an `@QuarkusTestResourceLifecycleManag * explicitly disable Dev Services and enable Dev Resources and use less-heavy concept of starting and stopping Dev Resources -* explicitly disable both Dev Services and Dev Resources, and use Quarkus' `@WithTestResource` testing concept (see Note) +* explicitly disable both Dev Services and Dev Resources, and use Quarkus' `@QuarkusTestResource` testing concept (see Note) You can either add Observability extension dependency along with needed Dev Resources dependencies, or you use existing `sinks` - pom.xml files which add Observability extension dependency along with other required dependencies for certain technology stacks; e.g. `victoriametrics` sink would have `quarkus-observability-devresource-victoriametrics` and `quarkus-victoriametrics-client` dependencies already included in the `pom.xml`. diff --git a/docs/src/main/asciidoc/rest-client.adoc b/docs/src/main/asciidoc/rest-client.adoc index 09d9af02496f5..bb2330f246523 100644 --- a/docs/src/main/asciidoc/rest-client.adoc +++ b/docs/src/main/asciidoc/rest-client.adoc @@ -1884,13 +1884,13 @@ testImplementation("org.wiremock:wiremock:$wiremockVersion") <1> ---- <1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here]. -In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.WithTestResource` +In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.QuarkusTestResource` annotation to specify a `io.quarkus.test.common.QuarkusTestResourceLifecycleManager` which can start the service and supply configuration values that Quarkus will use. [NOTE] ==== -For more details about `@WithTestResource` refer to xref:getting-started-testing.adoc#quarkus-test-resource[this part of the documentation]. +For more details about `@QuarkusTestResource` refer to xref:getting-started-testing.adoc#quarkus-test-resource[this part of the documentation]. ==== Let's create an implementation of `QuarkusTestResourceLifecycleManager` called `WiremockExtensions` like so: @@ -1954,12 +1954,17 @@ The `ExtensionsResourceTest` test class needs to be annotated like so: [source,java] ---- @QuarkusTest -@WithTestResource(WireMockExtensions.class) +@QuarkusTestResource(WireMockExtensions.class) public class ExtensionsResourceTest { } ---- +[WARNING] +==== +`@QuarkusTestResource` applies to all tests, not just `ExtensionsResourceTest`. +==== + == Known limitations While the REST Client extension aims to be a drop-in replacement for the RESTEasy Client extension, there are some differences diff --git a/docs/src/main/asciidoc/resteasy-client.adoc b/docs/src/main/asciidoc/resteasy-client.adoc index 096ae5b509b8d..a7df076880ee6 100644 --- a/docs/src/main/asciidoc/resteasy-client.adoc +++ b/docs/src/main/asciidoc/resteasy-client.adoc @@ -317,11 +317,11 @@ import static org.hamcrest.Matchers.greaterThan; import org.acme.rest.client.resources.WireMockExtensionsResource; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(WireMockExtensionsResource.class) +@QuarkusTestResource(WireMockExtensionsResource.class) public class ExtensionsResourceTest { @Test diff --git a/docs/src/main/asciidoc/security-oauth2.adoc b/docs/src/main/asciidoc/security-oauth2.adoc index 071f52b89ad9d..b4ece34f5f3fd 100644 --- a/docs/src/main/asciidoc/security-oauth2.adoc +++ b/docs/src/main/asciidoc/security-oauth2.adoc @@ -348,13 +348,13 @@ testImplementation("org.wiremock:wiremock:${wiremock.version}") <1> ---- <1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here]. -In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.WithTestResource` +In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.QuarkusTestResource` annotation to specify a `io.quarkus.test.common.QuarkusTestResourceLifecycleManager` which can start the service and supply configuration values that Quarkus will use. [NOTE] ==== -For more details about `@WithTestResource` refer to xref:getting-started-testing.adoc#quarkus-test-resource[this part of the documentation]. +For more details about `@QuarkusTestResource` refer to xref:getting-started-testing.adoc#quarkus-test-resource[this part of the documentation]. ==== Let's create an implementation of `QuarkusTestResourceLifecycleManager` called `MockAuthorizationServerTestResource` like so: @@ -402,14 +402,14 @@ public class MockAuthorizationServerTestResource implements QuarkusTestResourceL <5> When all tests have finished, shutdown Wiremock. -Your test class needs to be annotated like with `@WithTestResource(MockAuthorizationServerTestResource.class)` to use this `QuarkusTestResourceLifecycleManager`. +Your test class needs to be annotated like with `@QuarkusTestResource(MockAuthorizationServerTestResource.class)` to use this `QuarkusTestResourceLifecycleManager`. Below is an example of a test that uses the `MockAuthorizationServerTestResource`. [source,java] ---- @QuarkusTest -@WithTestResource(MockAuthorizationServerTestResource.class) // <1> +@QuarkusTestResource(MockAuthorizationServerTestResource.class) // <1> class TokenSecuredResourceTest { // use whatever token you want as the mock OAuth server will accept all tokens private static final String BEARER_TOKEN = "337aab0f-b547-489b-9dbd-a54dc7bdf20d"; // <2> @@ -442,6 +442,13 @@ class TokenSecuredResourceTest { <2> Define whatever token you want, it will not be validated by the OAuth2 mock authorization server. <3> Use this token inside the `Authorization` header to trigger OAuth2 authentication. + +[WARNING] +==== +`@QuarkusTestResource` applies to all tests, not just `TokenSecuredResourceTest`. +==== + + == References * https://tools.ietf.org/html/rfc6749[OAuth2] diff --git a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc index 0e77fe0e1ffb2..f82f975dfddef 100644 --- a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc @@ -617,14 +617,14 @@ import java.util.Set; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; import io.smallrye.jwt.build.Jwt; @QuarkusTest -@WithTestResource(OidcWiremockTestResource.class) +@QuarkusTestResource(OidcWiremockTestResource.class) public class BearerTokenAuthorizationTest { @Test @@ -926,13 +926,13 @@ import static org.hamcrest.Matchers.equalTo; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(KeycloakTestResourceLifecycleManager.class) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class BearerTokenAuthorizationTest { @Test diff --git a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc index c8b5f85888ee7..09616e3eb3c4d 100644 --- a/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc @@ -1755,12 +1755,12 @@ import org.htmlunit.WebClient; import org.htmlunit.html.HtmlForm; import org.htmlunit.html.HtmlPage; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.oidc.server.OidcWiremockTestResource; @QuarkusTest -@WithTestResource(OidcWiremockTestResource.class) +@QuarkusTestResource(OidcWiremockTestResource.class) public class CodeFlowAuthorizationTest { @Test @@ -1822,7 +1822,7 @@ quarkus.keycloak.devservices.realm-path=quarkus-realm.json ---- Finally, write a test code the same way as it is described in the <> section. -The only difference is that `@WithTestResource` is no longer needed: +The only difference is that `@QuarkusTestResource` is no longer needed: [source, java] ---- @@ -1878,14 +1878,14 @@ Then, configure the Maven Surefire plugin as follows (and similarly the Maven Fa ---- Now, set the configuration and write the test code the same way as it is described in the <> section. -The only difference is the name of `WithTestResource`: +The only difference is the name of `QuarkusTestResource`: [source, java] ---- import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; @QuarkusTest -@WithTestResource(KeycloakTestResourceLifecycleManager.class) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeFlowAuthorizationTest { } ---- diff --git a/extensions/agroal/deployment/src/test/java/io/quarkus/agroal/test/TestResources.java b/extensions/agroal/deployment/src/test/java/io/quarkus/agroal/test/TestResources.java index 4f8197941fc33..54f8f8c569b5a 100644 --- a/extensions/agroal/deployment/src/test/java/io/quarkus/agroal/test/TestResources.java +++ b/extensions/agroal/deployment/src/test/java/io/quarkus/agroal/test/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.agroal.test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/CacheTest.java b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/CacheTest.java index 4888abf88ade6..317f3b7485a5a 100644 --- a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/CacheTest.java +++ b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/CacheTest.java @@ -5,11 +5,11 @@ import io.quarkus.elytron.security.ldap.rest.SingleRoleSecuredServlet; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.ldap.LdapServerTestResource; import io.restassured.RestAssured; -@WithTestResource(value = LdapServerTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LdapServerTestResource.class) public class CacheTest { protected static Class[] testClasses = { SingleRoleSecuredServlet.class diff --git a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/LdapSecurityRealmTest.java b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/LdapSecurityRealmTest.java index 65662565f7b5b..f873ea5f1b76e 100644 --- a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/LdapSecurityRealmTest.java +++ b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/LdapSecurityRealmTest.java @@ -9,7 +9,7 @@ import io.quarkus.elytron.security.ldap.rest.SingleRoleSecuredServlet; import io.quarkus.elytron.security.ldap.rest.SubjectExposingResource; import io.quarkus.elytron.security.ldap.rest.TestApplication; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.ldap.LdapServerTestResource; import io.restassured.RestAssured; import io.restassured.specification.RequestSpecification; @@ -18,7 +18,7 @@ * Tests of BASIC authentication mechanism with the minimal config required */ -@WithTestResource(value = LdapServerTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LdapServerTestResource.class) public abstract class LdapSecurityRealmTest { protected static Class[] testClasses = { diff --git a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/SearchRecursiveTest.java b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/SearchRecursiveTest.java index 8557cef062e31..657dc530d64fc 100644 --- a/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/SearchRecursiveTest.java +++ b/extensions/elytron-security-ldap/deployment/src/test/java/io/quarkus/elytron/security/ldap/SearchRecursiveTest.java @@ -5,11 +5,11 @@ import io.quarkus.elytron.security.ldap.rest.SingleRoleSecuredServlet; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.ldap.LdapServerTestResource; import io.restassured.RestAssured; -@WithTestResource(value = LdapServerTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LdapServerTestResource.class) public class SearchRecursiveTest { protected static Class[] testClasses = { diff --git a/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayTestResources.java b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayTestResources.java index 6f82fc997dfd7..21512e52f6ffb 100644 --- a/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayTestResources.java +++ b/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayTestResources.java @@ -1,8 +1,8 @@ package io.quarkus.flyway.test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class FlywayTestResources { } diff --git a/extensions/liquibase/deployment/src/test/java/io/quarkus/liquibase/test/LiquibaseTestResources.java b/extensions/liquibase/deployment/src/test/java/io/quarkus/liquibase/test/LiquibaseTestResources.java index cd2ccc6d050de..6a1e0cbd6c29a 100644 --- a/extensions/liquibase/deployment/src/test/java/io/quarkus/liquibase/test/LiquibaseTestResources.java +++ b/extensions/liquibase/deployment/src/test/java/io/quarkus/liquibase/test/LiquibaseTestResources.java @@ -1,8 +1,8 @@ package io.quarkus.liquibase.test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class LiquibaseTestResources { } diff --git a/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/NamedOidcClientFilterDevModeTest.java b/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/NamedOidcClientFilterDevModeTest.java index 3cebc42490393..58e38e74b8f92 100644 --- a/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/NamedOidcClientFilterDevModeTest.java +++ b/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/NamedOidcClientFilterDevModeTest.java @@ -6,11 +6,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class NamedOidcClientFilterDevModeTest { private static final Class[] testClasses = { diff --git a/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/OidcClientFilterDevModeTest.java b/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/OidcClientFilterDevModeTest.java index 7e49d71662616..97cbbb8d7868c 100644 --- a/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/OidcClientFilterDevModeTest.java +++ b/extensions/oidc-client-filter/deployment/src/test/java/io/quarkus/oidc/client/filter/OidcClientFilterDevModeTest.java @@ -19,11 +19,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class OidcClientFilterDevModeTest { private static final Class[] testClasses = { diff --git a/extensions/oidc-client-graphql/deployment/src/test/java/io/quarkus/oidc/client/graphql/GraphQLClientUsingOidcClientTest.java b/extensions/oidc-client-graphql/deployment/src/test/java/io/quarkus/oidc/client/graphql/GraphQLClientUsingOidcClientTest.java index 7bce743d0565e..112fb47baf5cb 100644 --- a/extensions/oidc-client-graphql/deployment/src/test/java/io/quarkus/oidc/client/graphql/GraphQLClientUsingOidcClientTest.java +++ b/extensions/oidc-client-graphql/deployment/src/test/java/io/quarkus/oidc/client/graphql/GraphQLClientUsingOidcClientTest.java @@ -6,11 +6,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class GraphQLClientUsingOidcClientTest { private static final Class[] testClasses = { diff --git a/extensions/oidc-client-reactive-filter/deployment/src/test/java/io/quarkus/oidc/client/reactive/filter/NamedOidcClientFilterDevModeTest.java b/extensions/oidc-client-reactive-filter/deployment/src/test/java/io/quarkus/oidc/client/reactive/filter/NamedOidcClientFilterDevModeTest.java index e7cab2e3d064c..ef401cbe4d80d 100644 --- a/extensions/oidc-client-reactive-filter/deployment/src/test/java/io/quarkus/oidc/client/reactive/filter/NamedOidcClientFilterDevModeTest.java +++ b/extensions/oidc-client-reactive-filter/deployment/src/test/java/io/quarkus/oidc/client/reactive/filter/NamedOidcClientFilterDevModeTest.java @@ -6,11 +6,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class NamedOidcClientFilterDevModeTest { private static final Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/NamedOidcClientInjectionTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/NamedOidcClientInjectionTestCase.java index 63e84431a0c45..e06687718effd 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/NamedOidcClientInjectionTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/NamedOidcClientInjectionTestCase.java @@ -11,10 +11,10 @@ import io.quarkus.oidc.runtime.OidcUtils; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmUserPasswordManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmUserPasswordManager.class) public class NamedOidcClientInjectionTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyStoreTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyStoreTestCase.java index f04bf0b4dfd3c..fa47f73e9201a 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyStoreTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyStoreTestCase.java @@ -6,10 +6,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmClientCredentialsJwtPrivateKeyStoreManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmClientCredentialsJwtPrivateKeyStoreManager.class) public class OidcClientCredentialsJwtPrivateKeyStoreTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyTestCase.java index 80e1554793afe..d8252bd1a9614 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtPrivateKeyTestCase.java @@ -6,10 +6,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmClientCredentialsJwtPrivateKeyManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmClientCredentialsJwtPrivateKeyManager.class) public class OidcClientCredentialsJwtPrivateKeyTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtSecretTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtSecretTestCase.java index ffb5ecd139523..789becaf49510 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtSecretTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsJwtSecretTestCase.java @@ -21,10 +21,10 @@ import io.quarkus.deployment.recording.BytecodeRecorderImpl; import io.quarkus.runtime.annotations.Recorder; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmClientCredentialsJwtSecretManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmClientCredentialsJwtSecretManager.class) public class OidcClientCredentialsJwtSecretTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsTestCase.java index 6b1e25acc65ac..fe998f104859f 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientCredentialsTestCase.java @@ -8,10 +8,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmClientCredentialsManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmClientCredentialsManager.class) public class OidcClientCredentialsTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordCustomFilterTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordCustomFilterTestCase.java index d03360b00c1ba..994ba493909f3 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordCustomFilterTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordCustomFilterTestCase.java @@ -11,10 +11,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakRealmUserPasswordCustomFilterManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmUserPasswordCustomFilterManager.class) public class OidcClientUserPasswordCustomFilterTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordTestCase.java b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordTestCase.java index 9f015e98c60cf..388007bee0e6d 100644 --- a/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordTestCase.java +++ b/extensions/oidc-client/deployment/src/test/java/io/quarkus/oidc/client/OidcClientUserPasswordTestCase.java @@ -14,11 +14,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; import io.restassured.response.Response; -@WithTestResource(value = KeycloakRealmUserPasswordManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmUserPasswordManager.class) public class OidcClientUserPasswordTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/AccessTokenAnnotationTest.java b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/AccessTokenAnnotationTest.java index 6d84c48dd0fac..31e8aee1c6bd8 100644 --- a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/AccessTokenAnnotationTest.java +++ b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/AccessTokenAnnotationTest.java @@ -22,12 +22,12 @@ import io.quarkus.arc.Unremovable; import io.quarkus.oidc.token.propagation.AccessToken; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.client.OidcTestClient; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class AccessTokenAnnotationTest { final static OidcTestClient client = new OidcTestClient(); diff --git a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationTest.java b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationTest.java index c9ee6dafff025..ae0489140f12a 100644 --- a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationTest.java +++ b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationTest.java @@ -8,11 +8,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationTest { private static Class[] testClasses = { diff --git a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java index 9343971e68667..f90592f66199f 100644 --- a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java +++ b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java @@ -10,11 +10,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest { private static Class[] testClasses = { diff --git a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java index 73233bd99b5b2..61743be804e2e 100644 --- a/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java +++ b/extensions/oidc-token-propagation-reactive/deployment/src/test/java/io/quarkus/oidc/token/propagation/reactive/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java @@ -17,11 +17,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationWithSecurityIdentityAugmentorTest { private static Class[] testClasses = { diff --git a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/AccessTokenAnnotationTest.java b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/AccessTokenAnnotationTest.java index 5826ce0ae49b0..b38da82918eac 100644 --- a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/AccessTokenAnnotationTest.java +++ b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/AccessTokenAnnotationTest.java @@ -19,12 +19,12 @@ import io.quarkus.arc.Unremovable; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.client.OidcTestClient; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class AccessTokenAnnotationTest { final static OidcTestClient client = new OidcTestClient(); diff --git a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationTest.java b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationTest.java index 3c085d80054bb..2ad093b9bec6d 100644 --- a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationTest.java +++ b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationTest.java @@ -7,12 +7,12 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.client.OidcTestClient; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationTest { final static OidcTestClient client = new OidcTestClient(); diff --git a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java index 88af4bc5fd631..7a892d26497ec 100644 --- a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java +++ b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest.java @@ -10,11 +10,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationWithSecurityIdentityAugmentorLazyAuthTest { private static Class[] testClasses = { diff --git a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java index a4a40d4710df5..c2165254c3935 100644 --- a/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java +++ b/extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/OidcTokenPropagationWithSecurityIdentityAugmentorTest.java @@ -10,11 +10,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class OidcTokenPropagationWithSecurityIdentityAugmentorTest { private static Class[] testClasses = { diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeDefaultTenantTestCase.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeDefaultTenantTestCase.java index 09ce6e3a7f115..067351535035d 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeDefaultTenantTestCase.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeDefaultTenantTestCase.java @@ -14,10 +14,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeFlowDevModeDefaultTenantTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeTestCase.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeTestCase.java index c4e7bfbdc64eb..d0343742c27b7 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeTestCase.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowDevModeTestCase.java @@ -40,11 +40,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeFlowDevModeTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowRuntimeCredentialsProviderTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowRuntimeCredentialsProviderTest.java index a2d56a1ad7d7a..becaa00ea070e 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowRuntimeCredentialsProviderTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowRuntimeCredentialsProviderTest.java @@ -24,10 +24,10 @@ import io.quarkus.deployment.recording.BytecodeRecorderImpl; import io.quarkus.runtime.annotations.Recorder; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(value = KeycloakTestResourceLifecycleManager.class) public class CodeFlowRuntimeCredentialsProviderTest { private static final Class[] TEST_CLASSES = { diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyAccessTokenDisabledTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyAccessTokenDisabledTest.java index 510cbe22ddbcd..3bd36d0d3ccb1 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyAccessTokenDisabledTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyAccessTokenDisabledTest.java @@ -12,10 +12,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeFlowVerifyAccessTokenDisabledTest { @RegisterExtension diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyInjectedAccessTokenDisabledTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyInjectedAccessTokenDisabledTest.java index 6d5a439c3e294..dd9d217415214 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyInjectedAccessTokenDisabledTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeFlowVerifyInjectedAccessTokenDisabledTest.java @@ -12,10 +12,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeFlowVerifyInjectedAccessTokenDisabledTest { @RegisterExtension diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeTenantReauthenticateTestCase.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeTenantReauthenticateTestCase.java index 2b1954f62bf7d..51bc73fa55cd6 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeTenantReauthenticateTestCase.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CodeTenantReauthenticateTestCase.java @@ -16,11 +16,11 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CodeTenantReauthenticateTestCase { private static Class[] testClasses = { TenantReauthentication.class, diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CustomIdentityProviderTestCase.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CustomIdentityProviderTestCase.java index 8458bcfc9194f..7f7c1cfa1e41e 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CustomIdentityProviderTestCase.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/CustomIdentityProviderTestCase.java @@ -14,10 +14,10 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class CustomIdentityProviderTestCase { private static Class[] testClasses = { diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndBearerAuthCombinationTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndBearerAuthCombinationTest.java index 67f9a704a21d3..857130a08ef65 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndBearerAuthCombinationTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndBearerAuthCombinationTest.java @@ -12,12 +12,12 @@ import io.quarkus.oidc.BearerTokenAuthentication; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.quarkus.vertx.http.runtime.security.annotation.BasicAuthentication; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class ImplicitBasicAuthAndBearerAuthCombinationTest { @RegisterExtension diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndCodeFlowAuthCombinationTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndCodeFlowAuthCombinationTest.java index 4a61685e0f4bb..8abd7dad9ab2e 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndCodeFlowAuthCombinationTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/ImplicitBasicAuthAndCodeFlowAuthCombinationTest.java @@ -21,11 +21,11 @@ import io.quarkus.oidc.IdToken; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class ImplicitBasicAuthAndCodeFlowAuthCombinationTest { @RegisterExtension diff --git a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/UserInfoRequiredDetectionTest.java b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/UserInfoRequiredDetectionTest.java index fcab480106554..73633f3bbb4a1 100644 --- a/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/UserInfoRequiredDetectionTest.java +++ b/extensions/oidc/deployment/src/test/java/io/quarkus/oidc/test/UserInfoRequiredDetectionTest.java @@ -16,13 +16,13 @@ import io.quarkus.oidc.runtime.OidcConfig; import io.quarkus.security.PermissionsAllowed; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.keycloak.client.KeycloakTestClient; import io.quarkus.test.keycloak.server.KeycloakTestResourceLifecycleManager; import io.restassured.RestAssured; import io.vertx.ext.web.Router; -@WithTestResource(value = KeycloakTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakTestResourceLifecycleManager.class) public class UserInfoRequiredDetectionTest { @RegisterExtension diff --git a/extensions/panache/mongodb-panache-common/deployment/src/test/java/io/quarkus/mongodb/panache/common/MongoDatabaseResolverTest.java b/extensions/panache/mongodb-panache-common/deployment/src/test/java/io/quarkus/mongodb/panache/common/MongoDatabaseResolverTest.java index d75b6b9342354..ef3f4c2892a0a 100644 --- a/extensions/panache/mongodb-panache-common/deployment/src/test/java/io/quarkus/mongodb/panache/common/MongoDatabaseResolverTest.java +++ b/extensions/panache/mongodb-panache-common/deployment/src/test/java/io/quarkus/mongodb/panache/common/MongoDatabaseResolverTest.java @@ -26,12 +26,12 @@ import io.quarkus.mongodb.reactive.ReactiveMongoClient; import io.quarkus.mongodb.reactive.ReactiveMongoCollection; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.mongodb.MongoReplicaSetTestResource; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; -@WithTestResource(value = MongoReplicaSetTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoReplicaSetTestResource.class) @DisabledOnOs(OS.WINDOWS) public class MongoDatabaseResolverTest { diff --git a/extensions/redis-cache/deployment/src/test/java/io/quarkus/cache/redis/deployment/NamedRedisCacheTest.java b/extensions/redis-cache/deployment/src/test/java/io/quarkus/cache/redis/deployment/NamedRedisCacheTest.java index 95bb926fd0be0..5e03be1ef6e8d 100644 --- a/extensions/redis-cache/deployment/src/test/java/io/quarkus/cache/redis/deployment/NamedRedisCacheTest.java +++ b/extensions/redis-cache/deployment/src/test/java/io/quarkus/cache/redis/deployment/NamedRedisCacheTest.java @@ -14,9 +14,9 @@ import io.quarkus.redis.client.RedisClientName; import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class NamedRedisCacheTest { private static final String KEY_1 = "1"; diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/ClientInjectionTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/ClientInjectionTest.java index fb60bc99d36f5..0f01a54c2472a 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/ClientInjectionTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/ClientInjectionTest.java @@ -12,11 +12,11 @@ import io.quarkus.redis.client.RedisClientName; import io.quarkus.redis.client.reactive.ReactiveRedisClient; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.vertx.mutiny.redis.client.Redis; import io.vertx.mutiny.redis.client.RedisAPI; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class ClientInjectionTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/CustomizerTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/CustomizerTest.java index cdb1e2aedb48d..0b3f7a4f5d27d 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/CustomizerTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/CustomizerTest.java @@ -17,11 +17,11 @@ import io.quarkus.redis.client.RedisOptionsCustomizer; import io.quarkus.redis.runtime.client.config.RedisConfig; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.vertx.mutiny.redis.client.RedisAPI; import io.vertx.redis.client.RedisOptions; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class CustomizerTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/CustomCodecTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/CustomCodecTest.java index cbfa8d2fbcf64..39b9bd89e77de 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/CustomCodecTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/CustomCodecTest.java @@ -20,9 +20,9 @@ import io.quarkus.redis.datasource.hash.HashCommands; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class CustomCodecTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceInjectionTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceInjectionTest.java index 07634b9f9dbc1..0b9783ca44356 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceInjectionTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceInjectionTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class DataSourceInjectionTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceTest.java index 6006dd2b71ef0..736ec0e854098 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/datasource/DataSourceTest.java @@ -13,9 +13,9 @@ import io.quarkus.redis.datasource.value.ValueCommands; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class DataSourceTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientDevModeTestCase.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientDevModeTestCase.java index ea3b54a6dceef..905cef0d54fbc 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientDevModeTestCase.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientDevModeTestCase.java @@ -14,10 +14,10 @@ import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class RedisClientDevModeTestCase { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientPreloadDevModeTestCase.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientPreloadDevModeTestCase.java index 7ae35048d6c0e..dce82f588c555 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientPreloadDevModeTestCase.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/devmode/RedisClientPreloadDevModeTestCase.java @@ -12,10 +12,10 @@ import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.restassured.RestAssured; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class RedisClientPreloadDevModeTestCase { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/BinaryTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/BinaryTest.java index 84ba4cf2193dc..01cffd95c4dde 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/BinaryTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/BinaryTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.value.ValueCommands; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class BinaryTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CacheTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CacheTest.java index 4acf5b40f9f9a..aac3e85f7e441 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CacheTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CacheTest.java @@ -15,9 +15,9 @@ import io.quarkus.redis.datasource.value.ValueCommands; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class CacheTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CounterTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CounterTest.java index 675086caca2d6..7d0dc766a6781 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CounterTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/CounterTest.java @@ -13,9 +13,9 @@ import io.quarkus.redis.datasource.value.ValueCommands; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class CounterTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubOnStartupTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubOnStartupTest.java index 3c0ec81ce621f..2842c9cfd6d7d 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubOnStartupTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubOnStartupTest.java @@ -24,11 +24,11 @@ import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.runtime.Startup; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.subscription.Cancellable; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class PubSubOnStartupTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubTest.java index d2e8abd500ddd..a29a39d28c70e 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/patterns/PubSubTest.java @@ -22,9 +22,9 @@ import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.runtime.Startup; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class PubSubTest { @RegisterExtension static final QuarkusUnitTest unitTest = new QuarkusUnitTest() diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/DefaultFileForDefaultClientPreloadingTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/DefaultFileForDefaultClientPreloadingTest.java index 34e5d42950709..6419d9e4dd13e 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/DefaultFileForDefaultClientPreloadingTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/DefaultFileForDefaultClientPreloadingTest.java @@ -15,9 +15,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class DefaultFileForDefaultClientPreloadingTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MissingFilePreloadTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MissingFilePreloadTest.java index 7e6c09178c20e..64fc12756e415 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MissingFilePreloadTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MissingFilePreloadTest.java @@ -15,9 +15,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class MissingFilePreloadTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingTest.java index 39c5e6b3dd391..796d8adc174e4 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingTest.java @@ -17,9 +17,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class MultiClientImportPreloadingTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithFlushAllTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithFlushAllTest.java index d53f5a6169f69..ea0084b546cfb 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithFlushAllTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithFlushAllTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class MultiClientImportPreloadingWithFlushAllTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithOnlyIfEmptyTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithOnlyIfEmptyTest.java index cf5f3ec7b985d..3a875a126dba8 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithOnlyIfEmptyTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultiClientImportPreloadingWithOnlyIfEmptyTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class MultiClientImportPreloadingWithOnlyIfEmptyTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultipleFilesForDefaultClientImportPreloadingTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultipleFilesForDefaultClientImportPreloadingTest.java index 1b13cfd6698a4..900a34f0f3c68 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultipleFilesForDefaultClientImportPreloadingTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/MultipleFilesForDefaultClientImportPreloadingTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class MultipleFilesForDefaultClientImportPreloadingTest { @RegisterExtension diff --git a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/NonDefaultFileForDefaultClientImportPreloadingTest.java b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/NonDefaultFileForDefaultClientImportPreloadingTest.java index 6ff0a4de75eab..b21aa0528e91c 100644 --- a/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/NonDefaultFileForDefaultClientImportPreloadingTest.java +++ b/extensions/redis-client/deployment/src/test/java/io/quarkus/redis/deployment/client/preloading/NonDefaultFileForDefaultClientImportPreloadingTest.java @@ -16,9 +16,9 @@ import io.quarkus.redis.datasource.RedisDataSource; import io.quarkus.redis.deployment.client.RedisTestResource; import io.quarkus.test.QuarkusUnitTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(value = RedisTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RedisTestResource.class) public class NonDefaultFileForDefaultClientImportPreloadingTest { @RegisterExtension diff --git a/integration-tests/cache/src/test/java/io/quarkus/it/cache/TreeTestCase.java b/integration-tests/cache/src/test/java/io/quarkus/it/cache/TreeTestCase.java index 28833a8addcbb..71bdc7c26bbb2 100644 --- a/integration-tests/cache/src/test/java/io/quarkus/it/cache/TreeTestCase.java +++ b/integration-tests/cache/src/test/java/io/quarkus/it/cache/TreeTestCase.java @@ -7,12 +7,12 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) @DisplayName("Tests the integration between panache and the cache extension") public class TreeTestCase { diff --git a/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testAMQPContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java b/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testAMQPContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java index f697b8c71dc4e..2141299f2a62d 100644 --- a/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testAMQPContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java +++ b/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testAMQPContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java @@ -1,6 +1,6 @@ package ilove.quark.us; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; import io.quarkus.test.junit.QuarkusTest; diff --git a/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testKafkaContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java b/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testKafkaContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java index f697b8c71dc4e..2141299f2a62d 100644 --- a/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testKafkaContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java +++ b/integration-tests/devtools/src/test/resources/__snapshots__/ReactiveMessagingCodestartIT/testKafkaContent/src_test_java_ilove_quark_us_MyMessagingApplicationTest.java @@ -1,6 +1,6 @@ package ilove.quark.us; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; import io.quarkus.test.junit.QuarkusTest; diff --git a/integration-tests/elytron-security-jdbc/src/test/java/io/quarkus/elytron/security/jdbc/it/ElytronJdbcExtensionTestResources.java b/integration-tests/elytron-security-jdbc/src/test/java/io/quarkus/elytron/security/jdbc/it/ElytronJdbcExtensionTestResources.java index 80a28562e4a3b..944a9b8fb4b30 100644 --- a/integration-tests/elytron-security-jdbc/src/test/java/io/quarkus/elytron/security/jdbc/it/ElytronJdbcExtensionTestResources.java +++ b/integration-tests/elytron-security-jdbc/src/test/java/io/quarkus/elytron/security/jdbc/it/ElytronJdbcExtensionTestResources.java @@ -1,8 +1,8 @@ package io.quarkus.elytron.security.jdbc.it; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class ElytronJdbcExtensionTestResources { } diff --git a/integration-tests/elytron-security-ldap/src/test/java/io/quarkus/elytron/security/ldap/it/ElytronLdapExtensionTestResources.java b/integration-tests/elytron-security-ldap/src/test/java/io/quarkus/elytron/security/ldap/it/ElytronLdapExtensionTestResources.java index 705e18eb2b888..c0144886d8b05 100644 --- a/integration-tests/elytron-security-ldap/src/test/java/io/quarkus/elytron/security/ldap/it/ElytronLdapExtensionTestResources.java +++ b/integration-tests/elytron-security-ldap/src/test/java/io/quarkus/elytron/security/ldap/it/ElytronLdapExtensionTestResources.java @@ -1,8 +1,8 @@ package io.quarkus.elytron.security.ldap.it; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.ldap.LdapServerTestResource; -@WithTestResource(value = LdapServerTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LdapServerTestResource.class) public class ElytronLdapExtensionTestResources { } diff --git a/integration-tests/gradle/src/main/resources/custom-filesystem-provider/application/src/test/java/org/acme/ExampleResourceTest.java b/integration-tests/gradle/src/main/resources/custom-filesystem-provider/application/src/test/java/org/acme/ExampleResourceTest.java index ee212ae78de39..6b2e243fe8f1d 100644 --- a/integration-tests/gradle/src/main/resources/custom-filesystem-provider/application/src/test/java/org/acme/ExampleResourceTest.java +++ b/integration-tests/gradle/src/main/resources/custom-filesystem-provider/application/src/test/java/org/acme/ExampleResourceTest.java @@ -1,23 +1,23 @@ package org.acme; -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; -import io.quarkus.test.junit.QuarkusTest; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; @QuarkusTest -@WithTestResource(value = TestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(TestResource.class) public class ExampleResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello") - .then() - .statusCode(200) - .body(is("hello")); + .when().get("/hello") + .then() + .statusCode(200) + .body(is("hello")); } } \ No newline at end of file diff --git a/integration-tests/gradle/src/main/resources/inject-bean-from-test-config/application/src/test/java/org/acme/ExampleResourceTest.java b/integration-tests/gradle/src/main/resources/inject-bean-from-test-config/application/src/test/java/org/acme/ExampleResourceTest.java index a43bcda168cb5..9e48573de4616 100644 --- a/integration-tests/gradle/src/main/resources/inject-bean-from-test-config/application/src/test/java/org/acme/ExampleResourceTest.java +++ b/integration-tests/gradle/src/main/resources/inject-bean-from-test-config/application/src/test/java/org/acme/ExampleResourceTest.java @@ -1,18 +1,18 @@ package org.acme; import static org.junit.jupiter.api.Assertions.assertEquals; -import static io.restassured.RestAssured.given; -import static org.hamcrest.CoreMatchers.is; import jakarta.inject.Inject; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.common.QuarkusTestResource; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; -import io.quarkus.test.junit.QuarkusTest; +import static io.restassured.RestAssured.given; +import static org.hamcrest.CoreMatchers.is; @QuarkusTest -@WithTestResource(value = LibraryTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LibraryTestResource.class) public class ExampleResourceTest { @Inject @@ -21,10 +21,10 @@ public class ExampleResourceTest { @Test public void testHelloEndpoint() { given() - .when().get("/hello") - .then() - .statusCode(200) - .body(is("hello")); + .when().get("/hello") + .then() + .statusCode(200) + .body(is("hello")); assertEquals("test", libraryBean.getValue()); } diff --git a/integration-tests/grpc-hibernate/src/test/java/com/example/grpc/hibernate/TestResources.java b/integration-tests/grpc-hibernate/src/test/java/com/example/grpc/hibernate/TestResources.java index d1fbe2e7b4f28..37b0f78e27deb 100644 --- a/integration-tests/grpc-hibernate/src/test/java/com/example/grpc/hibernate/TestResources.java +++ b/integration-tests/grpc-hibernate/src/test/java/com/example/grpc/hibernate/TestResources.java @@ -1,8 +1,8 @@ package com.example.grpc.hibernate; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-orm-envers/src/test/java/io/quarkus/it/envers/TestResources.java b/integration-tests/hibernate-orm-envers/src/test/java/io/quarkus/it/envers/TestResources.java index a45abcc19839f..dd5de7ea79f4a 100644 --- a/integration-tests/hibernate-orm-envers/src/test/java/io/quarkus/it/envers/TestResources.java +++ b/integration-tests/hibernate-orm-envers/src/test/java/io/quarkus/it/envers/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.envers; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/TestResources.java b/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/TestResources.java index 123c3bd1cc90a..87980f0eb266d 100644 --- a/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/TestResources.java +++ b/integration-tests/hibernate-orm-graphql-panache/src/test/java/io/quarkus/it/hibertnate/orm/graphql/panache/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.hibertnate.orm.graphql.panache; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-orm-panache-kotlin/src/test/kotlin/io/quarkus/it/panache/TestResources.kt b/integration-tests/hibernate-orm-panache-kotlin/src/test/kotlin/io/quarkus/it/panache/TestResources.kt index 66ea4483d3f49..09ed042d4a64f 100644 --- a/integration-tests/hibernate-orm-panache-kotlin/src/test/kotlin/io/quarkus/it/panache/TestResources.kt +++ b/integration-tests/hibernate-orm-panache-kotlin/src/test/kotlin/io/quarkus/it/panache/TestResources.kt @@ -1,7 +1,6 @@ package io.quarkus.it.panache -import io.quarkus.test.common.WithTestResource +import io.quarkus.test.common.QuarkusTestResource import io.quarkus.test.h2.H2DatabaseTestResource -@WithTestResource(H2DatabaseTestResource::class, restrictToAnnotatedClass = false) -class TestResources +@QuarkusTestResource(H2DatabaseTestResource::class) class TestResources diff --git a/integration-tests/hibernate-orm-panache/src/test/java/io/quarkus/it/panache/defaultpu/TestResources.java b/integration-tests/hibernate-orm-panache/src/test/java/io/quarkus/it/panache/defaultpu/TestResources.java index 0634b8da653a1..93bc2f9d19bb7 100644 --- a/integration-tests/hibernate-orm-panache/src/test/java/io/quarkus/it/panache/defaultpu/TestResources.java +++ b/integration-tests/hibernate-orm-panache/src/test/java/io/quarkus/it/panache/defaultpu/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.panache.defaultpu; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-orm-rest-data-panache/src/test/java/io/quarkus/it/hibernate/orm/rest/data/panache/TestResources.java b/integration-tests/hibernate-orm-rest-data-panache/src/test/java/io/quarkus/it/hibernate/orm/rest/data/panache/TestResources.java index c4c0bca8459a5..47d334ac8a303 100644 --- a/integration-tests/hibernate-orm-rest-data-panache/src/test/java/io/quarkus/it/hibernate/orm/rest/data/panache/TestResources.java +++ b/integration-tests/hibernate-orm-rest-data-panache/src/test/java/io/quarkus/it/hibernate/orm/rest/data/panache/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.hibernate.orm.rest.data.panache; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-search-orm-elasticsearch-outbox-polling/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/coordination/outboxpolling/TestResources.java b/integration-tests/hibernate-search-orm-elasticsearch-outbox-polling/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/coordination/outboxpolling/TestResources.java index 8f3e7bdd33c54..8dc99c98d67b1 100644 --- a/integration-tests/hibernate-search-orm-elasticsearch-outbox-polling/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/coordination/outboxpolling/TestResources.java +++ b/integration-tests/hibernate-search-orm-elasticsearch-outbox-polling/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/coordination/outboxpolling/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.hibernate.search.orm.elasticsearch.coordination.outboxpolling; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-search-orm-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/TestResources.java b/integration-tests/hibernate-search-orm-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/TestResources.java index 4757330847fce..1cfd109ae8e1e 100644 --- a/integration-tests/hibernate-search-orm-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/TestResources.java +++ b/integration-tests/hibernate-search-orm-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/orm/elasticsearch/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.hibernate.search.orm.elasticsearch; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-search-orm-opensearch/src/test/java/io/quarkus/it/hibernate/search/orm/opensearch/TestResources.java b/integration-tests/hibernate-search-orm-opensearch/src/test/java/io/quarkus/it/hibernate/search/orm/opensearch/TestResources.java index 59d3e38f79025..87dd55d63b968 100644 --- a/integration-tests/hibernate-search-orm-opensearch/src/test/java/io/quarkus/it/hibernate/search/orm/opensearch/TestResources.java +++ b/integration-tests/hibernate-search-orm-opensearch/src/test/java/io/quarkus/it/hibernate/search/orm/opensearch/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.hibernate.search.orm.opensearch; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/hibernate-validator-resteasy-reactive/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java b/integration-tests/hibernate-validator-resteasy-reactive/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java index 28805dc218f42..c5db7e407f595 100644 --- a/integration-tests/hibernate-validator-resteasy-reactive/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java +++ b/integration-tests/hibernate-validator-resteasy-reactive/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java @@ -18,7 +18,7 @@ import io.quarkus.hibernate.validator.runtime.jaxrs.ResteasyReactiveViolationException; import io.quarkus.test.InMemoryLogHandler; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @@ -26,7 +26,7 @@ import io.restassured.response.ValidatableResponse; @QuarkusTest -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class HibernateValidatorFunctionalityTest { private static final Formatter LOG_FORMATTER = new PatternFormatter("%s"); private static final java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("io.quarkus"); diff --git a/integration-tests/hibernate-validator/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java b/integration-tests/hibernate-validator/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java index 353e1c1eaf405..880841201ec35 100644 --- a/integration-tests/hibernate-validator/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java +++ b/integration-tests/hibernate-validator/src/test/java/io/quarkus/it/hibernate/validator/HibernateValidatorFunctionalityTest.java @@ -14,8 +14,8 @@ import io.quarkus.hibernate.validator.runtime.jaxrs.ResteasyViolationExceptionImpl; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @@ -26,8 +26,8 @@ * Test various Bean Validation operations running in Quarkus */ @QuarkusTest -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(H2DatabaseTestResource.class) +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LOGGER, value = "io.quarkus"), @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING") }) diff --git a/integration-tests/infinispan-cache-jpa/src/test/java/io/quarkus/it/infinispan/cache/jpa/TestResources.java b/integration-tests/infinispan-cache-jpa/src/test/java/io/quarkus/it/infinispan/cache/jpa/TestResources.java index 62ded88ead828..4f8b31ecdc12a 100644 --- a/integration-tests/infinispan-cache-jpa/src/test/java/io/quarkus/it/infinispan/cache/jpa/TestResources.java +++ b/integration-tests/infinispan-cache-jpa/src/test/java/io/quarkus/it/infinispan/cache/jpa/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.infinispan.cache.jpa; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/jpa-db2/src/test/java/io/quarkus/it/jpa/db2/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-db2/src/test/java/io/quarkus/it/jpa/db2/HibernateOrmNoWarningsTest.java index 8d725a23d8ae1..3d95c4b0a6413 100644 --- a/integration-tests/jpa-db2/src/test/java/io/quarkus/it/jpa/db2/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-db2/src/test/java/io/quarkus/it/jpa/db2/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/HibernateOrmNoWarningsTest.java index 60260d9284596..4d61663dd21ee 100644 --- a/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/TestResources.java b/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/TestResources.java index 573b4b260ef2b..dc9ff6d8de8fe 100644 --- a/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/TestResources.java +++ b/integration-tests/jpa-derby/src/test/java/io/quarkus/it/jpa/derby/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.jpa.derby; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.derby.DerbyDatabaseTestResource; -@WithTestResource(value = DerbyDatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(DerbyDatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/jpa-h2-embedded/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-h2-embedded/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java index 8bd9220f4402d..0922b7ab32736 100644 --- a/integration-tests/jpa-h2-embedded/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-h2-embedded/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-h2/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-h2/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java index 207cecc01cdbf..9245c3ce6669c 100644 --- a/integration-tests/jpa-h2/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-h2/src/test/java/io/quarkus/it/jpa/h2/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), //We actually have a single warning, caused by the intentional peculiarities of io.quarkus.it.jpa.h2.CompanyCustomer: diff --git a/integration-tests/jpa-mariadb/src/test/java/io/quarkus/it/jpa/mariadb/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-mariadb/src/test/java/io/quarkus/it/jpa/mariadb/HibernateOrmNoWarningsTest.java index d4cc05b79ef1f..9769a98ff52a8 100644 --- a/integration-tests/jpa-mariadb/src/test/java/io/quarkus/it/jpa/mariadb/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-mariadb/src/test/java/io/quarkus/it/jpa/mariadb/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-mssql/src/test/java/io/quarkus/it/jpa/mssql/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-mssql/src/test/java/io/quarkus/it/jpa/mssql/HibernateOrmNoWarningsTest.java index 829deff127c72..6768f30c640b2 100644 --- a/integration-tests/jpa-mssql/src/test/java/io/quarkus/it/jpa/mssql/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-mssql/src/test/java/io/quarkus/it/jpa/mssql/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-mysql/src/test/java/io/quarkus/it/jpa/mysql/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-mysql/src/test/java/io/quarkus/it/jpa/mysql/HibernateOrmNoWarningsTest.java index c54b05faa6bb3..290c1c28c8f97 100644 --- a/integration-tests/jpa-mysql/src/test/java/io/quarkus/it/jpa/mysql/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-mysql/src/test/java/io/quarkus/it/jpa/mysql/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-oracle/src/test/java/io/quarkus/it/jpa/oracle/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-oracle/src/test/java/io/quarkus/it/jpa/oracle/HibernateOrmNoWarningsTest.java index 3cb2ec6b21992..51e4626659d48 100644 --- a/integration-tests/jpa-oracle/src/test/java/io/quarkus/it/jpa/oracle/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-oracle/src/test/java/io/quarkus/it/jpa/oracle/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa-postgresql/src/test/java/io/quarkus/it/jpa/postgresql/HibernateOrmNoWarningsTest.java b/integration-tests/jpa-postgresql/src/test/java/io/quarkus/it/jpa/postgresql/HibernateOrmNoWarningsTest.java index ee0b09694d20d..c433e055b5c55 100644 --- a/integration-tests/jpa-postgresql/src/test/java/io/quarkus/it/jpa/postgresql/HibernateOrmNoWarningsTest.java +++ b/integration-tests/jpa-postgresql/src/test/java/io/quarkus/it/jpa/postgresql/HibernateOrmNoWarningsTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Test; import io.quarkus.test.LogCollectingTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -19,7 +19,7 @@ * hence the lack of a corresponding native mode test. */ @QuarkusTest -@WithTestResource(value = LogCollectingTestResource.class, initArgs = { +@QuarkusTestResource(value = LogCollectingTestResource.class, restrictToAnnotatedClass = true, initArgs = { @ResourceArg(name = LogCollectingTestResource.LEVEL, value = "WARNING"), @ResourceArg(name = LogCollectingTestResource.INCLUDE, value = "org\\.hibernate\\..*"), // Ignore logs about schema management: diff --git a/integration-tests/jpa/src/test/java/io/quarkus/it/jpa/configurationless/TestResources.java b/integration-tests/jpa/src/test/java/io/quarkus/it/jpa/configurationless/TestResources.java index a7863f2142d06..2222dbc22d530 100644 --- a/integration-tests/jpa/src/test/java/io/quarkus/it/jpa/configurationless/TestResources.java +++ b/integration-tests/jpa/src/test/java/io/quarkus/it/jpa/configurationless/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.jpa.configurationless; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/kafka-avro-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaAvroIT.java b/integration-tests/kafka-avro-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaAvroIT.java index 7fc68998034b7..cde33e53f4a2c 100644 --- a/integration-tests/kafka-avro-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaAvroIT.java +++ b/integration-tests/kafka-avro-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaAvroIT.java @@ -5,12 +5,12 @@ import io.apicurio.registry.rest.client.RegistryClientFactory; import io.apicurio.rest.client.VertxHttpClientProvider; import io.quarkus.it.kafka.avro.AvroKafkaCreator; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.vertx.core.Vertx; @QuarkusIntegrationTest -@WithTestResource(KafkaResource.class) +@QuarkusTestResource(value = KafkaResource.class, restrictToAnnotatedClass = true) public class KafkaAvroIT extends KafkaAvroTestBase { AvroKafkaCreator creator; diff --git a/integration-tests/kafka-json-schema-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaJsonSchemaIT.java b/integration-tests/kafka-json-schema-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaJsonSchemaIT.java index 91a1be867cf42..31ddb23296938 100644 --- a/integration-tests/kafka-json-schema-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaJsonSchemaIT.java +++ b/integration-tests/kafka-json-schema-apicurio2/src/test/java/io/quarkus/it/kafka/KafkaJsonSchemaIT.java @@ -5,12 +5,12 @@ import io.apicurio.registry.rest.client.RegistryClientFactory; import io.apicurio.rest.client.VertxHttpClientProvider; import io.quarkus.it.kafka.jsonschema.JsonSchemaKafkaCreator; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.vertx.core.Vertx; @QuarkusIntegrationTest -@WithTestResource(KafkaResource.class) +@QuarkusTestResource(value = KafkaResource.class, restrictToAnnotatedClass = true) public class KafkaJsonSchemaIT extends KafkaJsonSchemaTestBase { JsonSchemaKafkaCreator creator; diff --git a/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthIT.java b/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthIT.java index 0ebbb14faf73f..e6904b0b05a70 100644 --- a/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthIT.java +++ b/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthIT.java @@ -1,10 +1,10 @@ package io.quarkus.it.kafka; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = KafkaKeycloakTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaKeycloakTestResource.class) public class KafkaOauthIT extends KafkaOauthTest { } diff --git a/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthTest.java b/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthTest.java index af921ca9a3d47..c450e43a8b5f9 100644 --- a/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthTest.java +++ b/integration-tests/kafka-oauth-keycloak/src/test/java/io/quarkus/it/kafka/KafkaOauthTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = KafkaKeycloakTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaKeycloakTestResource.class) public class KafkaOauthTest { protected static final TypeRef> TYPE_REF = new TypeRef>() { diff --git a/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslIT.java b/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslIT.java index 5b508486fedb5..6dd49ca3c4d7f 100644 --- a/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslIT.java +++ b/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslIT.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.common.mapper.TypeRef; @QuarkusIntegrationTest -@WithTestResource(value = KafkaSaslTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSaslTestResource.class) public class KafkaSaslIT { protected static final TypeRef> TYPE_REF = new TypeRef>() { diff --git a/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslTest.java b/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslTest.java index 966e7aa976745..6532f0c2586f9 100644 --- a/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslTest.java +++ b/integration-tests/kafka-sasl-elytron/src/test/java/io/quarkus/it/kafka/KafkaSaslTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = KafkaSaslTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSaslTestResource.class) public class KafkaSaslTest { protected static final TypeRef> TYPE_REF = new TypeRef>() { diff --git a/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerIT.java b/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerIT.java index d98d5d9b443e3..06c419fb681af 100644 --- a/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerIT.java +++ b/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerIT.java @@ -1,10 +1,10 @@ package io.quarkus.it.kafka; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = KafkaSASLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSASLTestResource.class) public class SaslKafkaConsumerIT extends SaslKafkaConsumerTest { } diff --git a/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerTest.java b/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerTest.java index 763e3d876894d..f88c6c59a5090 100644 --- a/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerTest.java +++ b/integration-tests/kafka-sasl/src/test/java/io/quarkus/it/kafka/SaslKafkaConsumerTest.java @@ -13,12 +13,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KafkaSASLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSASLTestResource.class) public class SaslKafkaConsumerTest { public Producer createProducer() { diff --git a/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyCodecTest.java b/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyCodecTest.java index 860c3de4ab629..a78831f712915 100644 --- a/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyCodecTest.java +++ b/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyCodecTest.java @@ -5,13 +5,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.config.ObjectMapperConfig; import io.restassured.mapper.ObjectMapperType; -@WithTestResource(value = KafkaTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaTestResource.class) @QuarkusTest public class KafkaSnappyCodecTest { diff --git a/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyConsumerTest.java b/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyConsumerTest.java index 87587c15a43b6..0024eec301b8c 100644 --- a/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyConsumerTest.java +++ b/integration-tests/kafka-snappy/src/test/java/io/quarkus/it/kafka/KafkaSnappyConsumerTest.java @@ -14,13 +14,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.config.ObjectMapperConfig; import io.restassured.mapper.ObjectMapperType; -@WithTestResource(value = KafkaTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaTestResource.class) @QuarkusTest public class KafkaSnappyConsumerTest { diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerITCase.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerITCase.java index 8c94592a57aa3..d5865ff946477 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerITCase.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerITCase.java @@ -1,13 +1,13 @@ package io.quarkus.it.kafka; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-jks") -}) +}, restrictToAnnotatedClass = true) public class SslJksKafkaConsumerITCase extends SslJksKafkaConsumerTest { } diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerTest.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerTest.java index 4496cc9b99f19..07b721c38dd12 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerTest.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslJksKafkaConsumerTest.java @@ -1,8 +1,8 @@ package io.quarkus.it.kafka; import io.quarkus.it.kafka.ssl.CertificateFormat; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.certs.Format; import io.smallrye.certs.junit5.Certificate; @@ -13,9 +13,9 @@ Format.PEM }, password = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L") }, baseDir = "target/certs") @QuarkusTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-jks") -}) +}, restrictToAnnotatedClass = true) public class SslJksKafkaConsumerTest extends SslKafkaConsumerTest { @Override diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerITCase.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerITCase.java index d8f4bd47503fe..d2d6cf0b3981a 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerITCase.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerITCase.java @@ -1,13 +1,13 @@ package io.quarkus.it.kafka; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-p12") -}) +}, restrictToAnnotatedClass = true) public class SslPKCS12KafkaConsumerITCase extends SslPKCS12KafkaConsumerTest { } diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerTest.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerTest.java index 22baaf6c182e6..5f272681988b0 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerTest.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPKCS12KafkaConsumerTest.java @@ -1,8 +1,8 @@ package io.quarkus.it.kafka; import io.quarkus.it.kafka.ssl.CertificateFormat; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.certs.Format; import io.smallrye.certs.junit5.Certificate; @@ -13,9 +13,9 @@ Format.PEM }, password = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L") }, baseDir = "target/certs") @QuarkusTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-p12") -}) +}, restrictToAnnotatedClass = true) public class SslPKCS12KafkaConsumerTest extends SslKafkaConsumerTest { @Override diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerITCase.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerITCase.java index 4c620d062c4f3..1a0eb1c790a28 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerITCase.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerITCase.java @@ -1,13 +1,13 @@ package io.quarkus.it.kafka; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-pem") -}) +}, restrictToAnnotatedClass = true) public class SslPemKafkaConsumerITCase extends SslPemKafkaConsumerTest { } diff --git a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerTest.java b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerTest.java index 2e14f29ae1cda..0e14827f08b80 100644 --- a/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerTest.java +++ b/integration-tests/kafka-ssl/src/test/java/io/quarkus/it/kafka/SslPemKafkaConsumerTest.java @@ -1,8 +1,8 @@ package io.quarkus.it.kafka; import io.quarkus.it.kafka.ssl.CertificateFormat; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.certs.Format; import io.smallrye.certs.junit5.Certificate; @@ -13,9 +13,9 @@ Format.PEM }, password = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L") }, baseDir = "target/certs") @QuarkusTest -@WithTestResource(value = KafkaSSLTestResource.class, initArgs = { +@QuarkusTestResource(value = KafkaSSLTestResource.class, initArgs = { @ResourceArg(name = "kafka.tls-configuration-name", value = "custom-pem") -}) +}, restrictToAnnotatedClass = true) public class SslPemKafkaConsumerTest extends SslKafkaConsumerTest { @Override diff --git a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsCdiEventTest.java b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsCdiEventTest.java index 8a30469bef7e1..8c7fffe1ff5b4 100644 --- a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsCdiEventTest.java +++ b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsCdiEventTest.java @@ -5,10 +5,10 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -@WithTestResource(value = KafkaSSLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSSLTestResource.class) @QuarkusTest public class KafkaStreamsCdiEventTest { diff --git a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsPropertiesTest.java b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsPropertiesTest.java index 9ab7b1ef521ba..8a56018dbeedb 100644 --- a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsPropertiesTest.java +++ b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsPropertiesTest.java @@ -11,10 +11,10 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -@WithTestResource(value = KafkaSSLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSSLTestResource.class) @QuarkusTest public class KafkaStreamsPropertiesTest { diff --git a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsStartupFailureTest.java b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsStartupFailureTest.java index 926326abbca6b..a68acba849e55 100644 --- a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsStartupFailureTest.java +++ b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsStartupFailureTest.java @@ -17,13 +17,13 @@ import io.quarkus.kafka.streams.runtime.KafkaStreamsTopologyManager; import io.quarkus.runtime.Application; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import io.restassured.RestAssured; -@WithTestResource(value = KafkaSSLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSSLTestResource.class) @TestProfile(KafkaStreamsStartupFailureTest.NonExistingTopicProfile.class) @QuarkusTest public class KafkaStreamsStartupFailureTest { diff --git a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsTest.java b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsTest.java index e3559561abe05..ae2f7ee91f9e5 100644 --- a/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsTest.java +++ b/integration-tests/kafka-streams/src/test/java/io/quarkus/it/kafka/streams/KafkaStreamsTest.java @@ -29,11 +29,11 @@ import io.quarkus.kafka.client.serialization.ObjectMapperDeserializer; import io.quarkus.kafka.client.serialization.ObjectMapperSerializer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -@WithTestResource(value = KafkaSSLTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaSSLTestResource.class) @QuarkusTest public class KafkaStreamsTest { diff --git a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaCodecTest.java b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaCodecTest.java index 348227d9c26cc..8ac8044d84532 100644 --- a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaCodecTest.java +++ b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaCodecTest.java @@ -5,14 +5,14 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.KafkaCompanionResource; import io.restassured.RestAssured; import io.restassured.config.ObjectMapperConfig; import io.restassured.mapper.ObjectMapperType; -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) @QuarkusTest public class KafkaCodecTest { diff --git a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaConsumerTest.java b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaConsumerTest.java index af950619fa9a1..2c2fbac8f1e09 100644 --- a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaConsumerTest.java +++ b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaConsumerTest.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.InjectKafkaCompanion; import io.quarkus.test.kafka.KafkaCompanionResource; @@ -16,7 +16,7 @@ import io.restassured.mapper.ObjectMapperType; import io.smallrye.reactive.messaging.kafka.companion.KafkaCompanion; -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) @QuarkusTest public class KafkaConsumerTest { diff --git a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaProducerTest.java b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaProducerTest.java index 2d561f06b7d20..81c44331b8cc6 100644 --- a/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaProducerTest.java +++ b/integration-tests/kafka/src/test/java/io/quarkus/it/kafka/KafkaProducerTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.InjectKafkaCompanion; import io.quarkus.test.kafka.KafkaCompanionResource; @@ -19,7 +19,7 @@ import io.smallrye.reactive.messaging.kafka.companion.ConsumerTask; import io.smallrye.reactive.messaging.kafka.companion.KafkaCompanion; -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) @QuarkusTest public class KafkaProducerTest { diff --git a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/DynamicTenantConfigPolicyEnforcerTest.java b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/DynamicTenantConfigPolicyEnforcerTest.java index 5bea1f51652f1..d091272415247 100644 --- a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/DynamicTenantConfigPolicyEnforcerTest.java +++ b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/DynamicTenantConfigPolicyEnforcerTest.java @@ -21,13 +21,13 @@ import io.quarkus.keycloak.pep.runtime.KeycloakPolicyEnforcerConfig; import io.quarkus.keycloak.pep.runtime.KeycloakPolicyEnforcerTenantConfig; import io.quarkus.runtime.util.StringUtil; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; @QuarkusTest -@WithTestResource(value = KeycloakLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakLifecycleManager.class) @TestProfile(DynamicTenantConfigPolicyEnforcerTest.DynamicTenantConfigResolverProfile.class) public class DynamicTenantConfigPolicyEnforcerTest extends AbstractPolicyEnforcerTest { diff --git a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/StaticTenantConfigPolicyEnforcerTest.java b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/StaticTenantConfigPolicyEnforcerTest.java index f43bb4c939508..90d685a9c989f 100644 --- a/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/StaticTenantConfigPolicyEnforcerTest.java +++ b/integration-tests/keycloak-authorization/src/test/java/io/quarkus/it/keycloak/StaticTenantConfigPolicyEnforcerTest.java @@ -2,11 +2,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = KeycloakLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(value = KeycloakLifecycleManager.class) public class StaticTenantConfigPolicyEnforcerTest extends AbstractPolicyEnforcerTest { @Test diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/AbsentConfigMapPropertiesPMT.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/AbsentConfigMapPropertiesPMT.java index 9db13b315d579..4f1a94cff8e4c 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/AbsentConfigMapPropertiesPMT.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/AbsentConfigMapPropertiesPMT.java @@ -7,9 +7,9 @@ import org.junit.jupiter.api.extension.RegisterExtension; import io.quarkus.test.QuarkusProdModeTest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesMockServerTestResource.class, restrictToAnnotatedClass = true) public class AbsentConfigMapPropertiesPMT { @RegisterExtension diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/ConfigMapPropertiesTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/ConfigMapPropertiesTest.java index 7a8c86457bfda..03d0102941a06 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/ConfigMapPropertiesTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/ConfigMapPropertiesTest.java @@ -5,10 +5,10 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesMockServerTestResource.class, restrictToAnnotatedClass = true) @QuarkusTest public class ConfigMapPropertiesTest { diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java index 1a2135835f8d2..3961655f0f30c 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java @@ -18,7 +18,7 @@ import io.fabric8.kubernetes.api.model.PodListBuilder; import io.fabric8.kubernetes.client.internal.CertUtils; import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kubernetes.client.MockServer; import io.restassured.RestAssured; @@ -27,7 +27,7 @@ * KubernetesClientTest.TestResource contains the entire process of setting up the Mock Kubernetes API Server * It has to live there otherwise the Kubernetes client in native mode won't be able to locate the mock API Server */ -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesMockServerTestResource.class, restrictToAnnotatedClass = true) @QuarkusTest public class KubernetesClientTest { diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesNewClientTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesNewClientTest.java index ba092eb5da1cf..9eabaacc6d954 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesNewClientTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesNewClientTest.java @@ -8,7 +8,7 @@ import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodBuilder; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kubernetes.client.KubernetesTestServer; import io.restassured.RestAssured; @@ -17,7 +17,7 @@ * KubernetesClientTest.TestResource contains the entire process of setting up the Mock Kubernetes API Server * It has to live there otherwise the Kubernetes client in native mode won't be able to locate the mock API Server */ -@WithTestResource(CustomKubernetesTestServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesTestServerTestResource.class, restrictToAnnotatedClass = true) @QuarkusTest class KubernetesNewClientTest { diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/NamespacedConfigMapPropertiesTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/NamespacedConfigMapPropertiesTest.java index f72d4e2e7ec2b..ea203c1c90b15 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/NamespacedConfigMapPropertiesTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/NamespacedConfigMapPropertiesTest.java @@ -5,12 +5,12 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesMockServerTestResource.class, restrictToAnnotatedClass = true) @TestProfile(NamespacedConfigMapPropertiesTest.MyProfile.class) @QuarkusTest public class NamespacedConfigMapPropertiesTest { diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/SecretPropertiesTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/SecretPropertiesTest.java index 02580f47dd099..425fef9d150f7 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/SecretPropertiesTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/SecretPropertiesTest.java @@ -5,10 +5,10 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -@WithTestResource(CustomKubernetesMockServerTestResource.class) +@QuarkusTestResource(value = CustomKubernetesMockServerTestResource.class, restrictToAnnotatedClass = true) @QuarkusTest public class SecretPropertiesTest { diff --git a/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/FruitResourceTest.java b/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/FruitResourceTest.java index ebe2268e6dd95..f87033d050171 100644 --- a/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/FruitResourceTest.java +++ b/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/FruitResourceTest.java @@ -18,13 +18,13 @@ import com.mongodb.client.ListIndexesIterable; import com.mongodb.client.MongoClient; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.mongodb.MongoTestResource; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = MongoTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoTestResource.class) @DisabledOnOs(OS.WINDOWS) class FruitResourceTest { diff --git a/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/NativeFruitResourceTestIT.java b/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/NativeFruitResourceTestIT.java index 81362c25d2bd4..7d3cd68437683 100644 --- a/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/NativeFruitResourceTestIT.java +++ b/integration-tests/liquibase-mongodb/src/test/java/io/quarkus/it/liquibase/mongodb/NativeFruitResourceTestIT.java @@ -9,13 +9,13 @@ import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.quarkus.test.mongodb.MongoTestResource; import io.restassured.common.mapper.TypeRef; @QuarkusIntegrationTest -@WithTestResource(value = MongoTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoTestResource.class) @DisabledOnOs(OS.WINDOWS) class NativeFruitResourceTestIT { @Test diff --git a/integration-tests/liquibase/src/test/java/io/quarkus/it/liquibase/LiquibaseTestResources.java b/integration-tests/liquibase/src/test/java/io/quarkus/it/liquibase/LiquibaseTestResources.java index 4ea994ff530ca..499a1291b287b 100644 --- a/integration-tests/liquibase/src/test/java/io/quarkus/it/liquibase/LiquibaseTestResources.java +++ b/integration-tests/liquibase/src/test/java/io/quarkus/it/liquibase/LiquibaseTestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.liquibase; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class LiquibaseTestResources { } diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingFilterTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingFilterTest.java index 1d5fe9486798e..2556243f76013 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingFilterTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingFilterTest.java @@ -5,11 +5,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingFilterTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelAboveTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelAboveTest.java index 996f25f6c743e..0494c00722ac0 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelAboveTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelAboveTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -13,7 +13,7 @@ * and this can be further tweaked at runtime to go to above to an even higher level. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelAboveTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowChildTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowChildTest.java index 760f37cd216bd..4ae4a80484490 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowChildTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowChildTest.java @@ -5,14 +5,14 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** * Test verifies that a min-level override that goes below the default min-level is applied correctly. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelBelowChildTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowTest.java index afc6def35c1e5..ced72852db9bf 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelBelowTest.java @@ -5,14 +5,14 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** * Test verifies that a min-level override that goes below the default min-level is applied correctly. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelBelowTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelByDefaultTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelByDefaultTest.java index f8e5d3450a34b..b4a79abf90a9d 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelByDefaultTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelByDefaultTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -16,7 +16,7 @@ * say to DEBUG, the code works as expected. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelByDefaultTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteSubTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteSubTest.java index c17c56ed82f85..9b7e978754b3e 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteSubTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteSubTest.java @@ -5,14 +5,14 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** * This test verifies that log levels are promoted to min-level when set below, even for subpackages. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelPromoteSubTest { @Test diff --git a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteTest.java b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteTest.java index 2da3e20f16bdc..bd4e8208828fc 100644 --- a/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteTest.java +++ b/integration-tests/logging-min-level-set/src/test/java/io/quarkus/it/logging/minlevel/set/LoggingMinLevelPromoteTest.java @@ -5,14 +5,14 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** * This test verifies that log levels are promoted to min-level when set below. */ @QuarkusTest -@WithTestResource(value = SetRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetRuntimeLogLevels.class) public class LoggingMinLevelPromoteTest { @Test diff --git a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelAboveTest.java b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelAboveTest.java index a536b6b887b6c..b96233e999946 100644 --- a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelAboveTest.java +++ b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelAboveTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -13,7 +13,7 @@ * and only messages at same runtime log level or above are shown. */ @QuarkusTest -@WithTestResource(value = SetCategoryRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetCategoryRuntimeLogLevels.class) public class LoggingMinLevelAboveTest { @Test diff --git a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelByDefaultTest.java b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelByDefaultTest.java index ea91082127707..d52fce3a7b56f 100644 --- a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelByDefaultTest.java +++ b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelByDefaultTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -13,7 +13,7 @@ * and there's no applicable runtime log level override. */ @QuarkusTest -@WithTestResource(value = SetCategoryRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetCategoryRuntimeLogLevels.class) public class LoggingMinLevelByDefaultTest { @Test diff --git a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelGlobalTest.java b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelGlobalTest.java index 9999b1339bc80..a94ba4de4fb12 100644 --- a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelGlobalTest.java +++ b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelGlobalTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -13,7 +13,7 @@ * and the global log level is below it. */ @QuarkusTest -@WithTestResource(value = SetGlobalRuntimeLogLevel.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetGlobalRuntimeLogLevel.class) public class LoggingMinLevelGlobalTest { @Test diff --git a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelPromoteTest.java b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelPromoteTest.java index b6740f8f672cd..c3b27db977dbc 100644 --- a/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelPromoteTest.java +++ b/integration-tests/logging-min-level-unset/src/test/java/io/quarkus/it/logging/minlevel/unset/LoggingMinLevelPromoteTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -16,7 +16,7 @@ * it will be automatically promoted to DEBUG. */ @QuarkusTest -@WithTestResource(value = SetCategoryRuntimeLogLevels.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SetCategoryRuntimeLogLevels.class) public class LoggingMinLevelPromoteTest { @Test diff --git a/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerIT.java b/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerIT.java index 235a69e17ad6a..64a2986c7ab17 100644 --- a/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerIT.java +++ b/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerIT.java @@ -1,10 +1,10 @@ package io.quarkus.it.mailer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; @QuarkusIntegrationTest -@WithTestResource(value = MailpitTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MailpitTestResource.class) public class MailerIT extends MailerTest { } diff --git a/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerTest.java b/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerTest.java index 84b52b25a4dd2..846414150d16a 100644 --- a/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerTest.java +++ b/integration-tests/mailer/src/test/java/io/quarkus/it/mailer/MailerTest.java @@ -17,7 +17,7 @@ import io.quarkus.it.mailer.mailpit.MailPitClient; import io.quarkus.it.mailer.mailpit.Message; import io.quarkus.it.mailer.mailpit.Recipient; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.vertx.core.json.JsonObject; @@ -27,8 +27,8 @@ */ @DisabledOnOs({ OS.WINDOWS }) @QuarkusTest -@WithTestResource(value = MailpitTestResource.class, restrictToAnnotatedClass = false) -@WithTestResource(value = MailpitFullTlsTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MailpitTestResource.class) +@QuarkusTestResource(MailpitFullTlsTestResource.class) public class MailerTest { private MailPitClient client; private MailPitClient clientTls; diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/GetExceptionsInTestResourceTestCase.java b/integration-tests/main/src/test/java/io/quarkus/it/main/GetExceptionsInTestResourceTestCase.java index af90597a55e9e..1e02474fe46bf 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/GetExceptionsInTestResourceTestCase.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/GetExceptionsInTestResourceTestCase.java @@ -12,12 +12,12 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.LifecycleMethodExecutionExceptionHandler; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTestExtension; @ExtendWith({ GetExceptionsInTestResourceTestCase.IgnoreCustomExceptions.class, QuarkusTestExtension.class }) -@WithTestResource(GetExceptionsInTestResourceTestCase.KeepContextTestResource.class) +@QuarkusTestResource(restrictToAnnotatedClass = true, value = GetExceptionsInTestResourceTestCase.KeepContextTestResource.class) public class GetExceptionsInTestResourceTestCase { public static final AtomicReference CONTEXT = new AtomicReference<>(); diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNestedWithResourcesTestCase.java b/integration-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNestedWithResourcesTestCase.java index e0338d142e9d4..19290533b1946 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNestedWithResourcesTestCase.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNestedWithResourcesTestCase.java @@ -15,8 +15,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; /** @@ -28,7 +28,7 @@ */ @QuarkusTest @Tag("nested") -@WithTestResource(QuarkusTestNestedWithResourcesTestCase.DummyTestResource.class) +@QuarkusTestResource(value = QuarkusTestNestedWithResourcesTestCase.DummyTestResource.class, restrictToAnnotatedClass = true) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class QuarkusTestNestedWithResourcesTestCase { diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/TestResources.java b/integration-tests/main/src/test/java/io/quarkus/it/main/TestResources.java index 46ca1e18472fe..2c8f12d2518df 100644 --- a/integration-tests/main/src/test/java/io/quarkus/it/main/TestResources.java +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.main; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/micrometer-prometheus/src/test/java/io/quarkus/it/micrometer/prometheus/TestResources.java b/integration-tests/micrometer-prometheus/src/test/java/io/quarkus/it/micrometer/prometheus/TestResources.java index 43295a4dc5512..49a22905af3e5 100644 --- a/integration-tests/micrometer-prometheus/src/test/java/io/quarkus/it/micrometer/prometheus/TestResources.java +++ b/integration-tests/micrometer-prometheus/src/test/java/io/quarkus/it/micrometer/prometheus/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.micrometer.prometheus; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/mongodb-client/src/test/java/io/quarkus/it/mongodb/BookResourceTest.java b/integration-tests/mongodb-client/src/test/java/io/quarkus/it/mongodb/BookResourceTest.java index d994be917ed01..4b5f0edd38449 100644 --- a/integration-tests/mongodb-client/src/test/java/io/quarkus/it/mongodb/BookResourceTest.java +++ b/integration-tests/mongodb-client/src/test/java/io/quarkus/it/mongodb/BookResourceTest.java @@ -12,13 +12,13 @@ import org.junit.jupiter.api.Test; import io.quarkus.mongodb.health.MongoHealthCheck; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.mongodb.MongoTestResource; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = MongoTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(value = MongoTestResource.class) public class BookResourceTest { private static Jsonb jsonb; diff --git a/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/MongodbPanacheResourceTest.kt b/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/MongodbPanacheResourceTest.kt index 93f85f175033a..41f54b3a98b6f 100644 --- a/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/MongodbPanacheResourceTest.kt +++ b/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/MongodbPanacheResourceTest.kt @@ -6,7 +6,7 @@ import com.fasterxml.jackson.datatype.jdk8.Jdk8Module import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import io.quarkus.it.mongodb.panache.book.BookDetail import io.quarkus.it.mongodb.panache.person.Person -import io.quarkus.test.common.WithTestResource +import io.quarkus.test.common.QuarkusTestResource import io.quarkus.test.junit.QuarkusTest import io.quarkus.test.mongodb.MongoTestResource import io.restassured.RestAssured @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @QuarkusTest -@WithTestResource(MongoTestResource::class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoTestResource::class) open class MongodbPanacheResourceTest { @Test fun testBookEntity() { diff --git a/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/reactive/ReactiveMongodbPanacheResourceTest.kt b/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/reactive/ReactiveMongodbPanacheResourceTest.kt index ce6ffc36d0e71..f62245276a78c 100644 --- a/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/reactive/ReactiveMongodbPanacheResourceTest.kt +++ b/integration-tests/mongodb-panache-kotlin/src/test/kotlin/io/quarkus/it/mongodb/panache/reactive/ReactiveMongodbPanacheResourceTest.kt @@ -7,7 +7,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import io.quarkus.it.mongodb.panache.BookDTO import io.quarkus.it.mongodb.panache.book.BookDetail import io.quarkus.it.mongodb.panache.person.Person -import io.quarkus.test.common.WithTestResource +import io.quarkus.test.common.QuarkusTestResource import io.quarkus.test.junit.QuarkusTest import io.quarkus.test.mongodb.MongoTestResource import io.restassured.RestAssured @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Test @QuarkusTest -@WithTestResource(MongoTestResource::class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoTestResource::class) internal open class ReactiveMongodbPanacheResourceTest { companion object { private val LIST_OF_BOOK_TYPE_REF: TypeRef> = diff --git a/integration-tests/mongodb-panache/src/test/java/io/quarkus/it/mongodb/panache/MongoTestResources.java b/integration-tests/mongodb-panache/src/test/java/io/quarkus/it/mongodb/panache/MongoTestResources.java index 5b88c40ce5d02..9326b60a25f08 100644 --- a/integration-tests/mongodb-panache/src/test/java/io/quarkus/it/mongodb/panache/MongoTestResources.java +++ b/integration-tests/mongodb-panache/src/test/java/io/quarkus/it/mongodb/panache/MongoTestResources.java @@ -1,9 +1,9 @@ package io.quarkus.it.mongodb.panache; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.mongodb.MongoReplicaSetTestResource; -@WithTestResource(value = MongoReplicaSetTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MongoReplicaSetTestResource.class) public class MongoTestResources { } diff --git a/integration-tests/mongodb-rest-data-panache/src/test/java/io/quarkus/it/mongodb/rest/data/panache/MongoDbRestDataPanacheTest.java b/integration-tests/mongodb-rest-data-panache/src/test/java/io/quarkus/it/mongodb/rest/data/panache/MongoDbRestDataPanacheTest.java index 06148724c4754..5287ec9cce4a8 100644 --- a/integration-tests/mongodb-rest-data-panache/src/test/java/io/quarkus/it/mongodb/rest/data/panache/MongoDbRestDataPanacheTest.java +++ b/integration-tests/mongodb-rest-data-panache/src/test/java/io/quarkus/it/mongodb/rest/data/panache/MongoDbRestDataPanacheTest.java @@ -17,14 +17,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.mongodb.MongoTestResource; import io.restassured.response.Response; @QuarkusTest -@WithTestResource(value = MongoTestResource.class, restrictToAnnotatedClass = false, initArgs = @ResourceArg(name = MongoTestResource.PORT, value = "37017")) +@QuarkusTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.PORT, value = "37017")) class MongoDbRestDataPanacheTest { private Author dostoevsky; diff --git a/integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmLifecycleTest.java b/integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmLifecycleTest.java index 8be29e8d0c846..016e69236ac3c 100644 --- a/integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmLifecycleTest.java +++ b/integration-tests/observability-lgtm/src/test/java/io/quarkus/observability/test/LgtmLifecycleTest.java @@ -6,13 +6,13 @@ import org.junit.jupiter.api.condition.OS; import io.quarkus.observability.devresource.lgtm.LgtmResource; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; @QuarkusTest -@WithTestResource(LgtmResource.class) +@QuarkusTestResource(value = LgtmResource.class, restrictToAnnotatedClass = true) @TestProfile(LgtmLifecycleTest.TestResourceTestProfileOff.class) @DisabledOnOs(OS.WINDOWS) public class LgtmLifecycleTest extends LgtmTestBase { diff --git a/integration-tests/oidc-client-wiremock/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java b/integration-tests/oidc-client-wiremock/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java index 26c9aca0624db..b21fa0c95f83e 100644 --- a/integration-tests/oidc-client-wiremock/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java +++ b/integration-tests/oidc-client-wiremock/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java @@ -25,12 +25,12 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class OidcClientTest { @InjectWireMock diff --git a/integration-tests/oidc-client/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java b/integration-tests/oidc-client/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java index d5a66e2c44cf5..c6d8aca5b9bf9 100644 --- a/integration-tests/oidc-client/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java +++ b/integration-tests/oidc-client/src/test/java/io/quarkus/it/keycloak/OidcClientTest.java @@ -21,12 +21,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class OidcClientTest { @Test diff --git a/integration-tests/oidc-code-flow/src/test/java/io/quarkus/it/keycloak/CodeFlowTest.java b/integration-tests/oidc-code-flow/src/test/java/io/quarkus/it/keycloak/CodeFlowTest.java index 3b1e45505da7c..9629c61ce5dab 100644 --- a/integration-tests/oidc-code-flow/src/test/java/io/quarkus/it/keycloak/CodeFlowTest.java +++ b/integration-tests/oidc-code-flow/src/test/java/io/quarkus/it/keycloak/CodeFlowTest.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test; import io.quarkus.oidc.runtime.OidcUtils; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.keycloak.client.KeycloakTestClient; import io.restassured.RestAssured; @@ -45,7 +45,7 @@ * @author Pedro Igor */ @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class CodeFlowTest { KeycloakTestClient client = new KeycloakTestClient(); diff --git a/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java b/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java index 39871ba90f7a7..a1e7e351e9e29 100644 --- a/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java +++ b/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.keycloak.client.KeycloakTestClient; import io.restassured.RestAssured; @@ -40,7 +40,7 @@ * @author Pedro Igor */ @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class BearerTokenAuthorizationTest { private KeycloakTestClient client = new KeycloakTestClient(); diff --git a/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/TestSecurityCombiningAuthMechTest.java b/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/TestSecurityCombiningAuthMechTest.java index 96ce4db1a038c..21d5636f81f95 100644 --- a/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/TestSecurityCombiningAuthMechTest.java +++ b/integration-tests/oidc-tenancy/src/test/java/io/quarkus/it/keycloak/TestSecurityCombiningAuthMechTest.java @@ -14,7 +14,7 @@ import org.htmlunit.html.HtmlPage; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPEndpoint; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.security.TestSecurity; @@ -22,7 +22,7 @@ import io.restassured.http.ContentType; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class TestSecurityCombiningAuthMechTest { @TestHTTPEndpoint(MultipleAuthMechResource.class) diff --git a/integration-tests/oidc-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java b/integration-tests/oidc-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java index 207f14dad78dd..bcd717025d989 100644 --- a/integration-tests/oidc-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java +++ b/integration-tests/oidc-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java @@ -5,13 +5,13 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.keycloak.client.KeycloakTestClient; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class OidcTokenPropagationTest { final KeycloakTestClient client = new KeycloakTestClient(); @@ -44,7 +44,7 @@ public void testGetUserNameWithAccessTokenPropagation() { // Note this test does pass if Keycloak is started manually, // 'quarkus' realm, 'quarkus-app' and 'quarkus-app-exchange' clients, and 'alice' user is created // and the token-exchange permission is added to the clients as per the Keycloak docs. - // It can be confirmed by commenting @WithTestResource above + // It can be confirmed by commenting @QuarkusTestResource above // and running the tests as 'mvn clean install -Dtest-containers' RestAssured.given().auth().oauth2(getAccessToken("alice")) diff --git a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/AnnotationBasedTenantTest.java b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/AnnotationBasedTenantTest.java index d05f3138c2cff..3e5fb78ce14fd 100644 --- a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/AnnotationBasedTenantTest.java +++ b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/AnnotationBasedTenantTest.java @@ -12,7 +12,7 @@ import io.quarkus.oidc.runtime.OidcUtils; import io.quarkus.security.identity.SecurityIdentity; import io.quarkus.security.spi.runtime.AuthorizationSuccessEvent; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; @@ -23,7 +23,7 @@ @QuarkusTest @TestProfile(AnnotationBasedTenantTest.NoProactiveAuthTestProfile.class) -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class AnnotationBasedTenantTest { public static class NoProactiveAuthTestProfile implements QuarkusTestProfile { public Map getConfigOverrides() { diff --git a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerOpaqueTokenAuthorizationTest.java b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerOpaqueTokenAuthorizationTest.java index 52109c3e95102..2c70886ec6fa4 100644 --- a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerOpaqueTokenAuthorizationTest.java +++ b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerOpaqueTokenAuthorizationTest.java @@ -14,14 +14,14 @@ import com.github.tomakehurst.wiremock.WireMockServer; import io.quarkus.oidc.common.runtime.OidcConstants; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.oidc.server.OidcWireMock; import io.quarkus.test.oidc.server.OidcWiremockTestResource; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class BearerOpaqueTokenAuthorizationTest { @OidcWireMock diff --git a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java index caeb1e47adbee..6977986b7d99f 100644 --- a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java +++ b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java @@ -30,7 +30,7 @@ import io.quarkus.deployment.util.FileUtil; import io.quarkus.oidc.runtime.OidcUtils; import io.quarkus.oidc.runtime.TrustStoreUtils; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.oidc.server.OidcWireMock; import io.quarkus.test.oidc.server.OidcWiremockTestResource; @@ -43,7 +43,7 @@ import io.vertx.core.json.JsonObject; @QuarkusTest -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class BearerTokenAuthorizationTest { @OidcWireMock diff --git a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/CodeFlowAuthorizationTest.java b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/CodeFlowAuthorizationTest.java index 66a3931fc3dc7..b8a747756eea8 100644 --- a/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/CodeFlowAuthorizationTest.java +++ b/integration-tests/oidc-wiremock/src/test/java/io/quarkus/it/keycloak/CodeFlowAuthorizationTest.java @@ -52,7 +52,7 @@ import io.quarkus.oidc.common.runtime.OidcCommonUtils; import io.quarkus.oidc.runtime.OidcUtils; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.oidc.server.OidcWireMock; import io.quarkus.test.oidc.server.OidcWiremockTestResource; @@ -65,7 +65,7 @@ import io.vertx.core.json.JsonObject; @QuarkusTest -@WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OidcWiremockTestResource.class) public class CodeFlowAuthorizationTest { @OidcWireMock diff --git a/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java b/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java index 1107ab10f9e35..06e635866911c 100644 --- a/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java +++ b/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/BearerTokenAuthorizationTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.RepeatedTest; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @@ -20,7 +20,7 @@ * @author Pedro Igor */ @QuarkusTest -@WithTestResource(value = KeycloakXTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakXTestResourceLifecycleManager.class) public class BearerTokenAuthorizationTest { @Test diff --git a/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/WebsocketOidcTestCase.java b/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/WebsocketOidcTestCase.java index 7f2d5b882ae9d..b998d0bf7bc3b 100644 --- a/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/WebsocketOidcTestCase.java +++ b/integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/WebsocketOidcTestCase.java @@ -15,13 +15,13 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.websockets.BearerTokenClientEndpointConfigurator; @QuarkusTest -@WithTestResource(value = KeycloakXTestResourceLifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakXTestResourceLifecycleManager.class) public class WebsocketOidcTestCase { @TestHTTPResource("secured-hello") diff --git a/integration-tests/openshift-client/src/test/java/io/quarkus/it/openshift/client/OpenShiftClientTest.java b/integration-tests/openshift-client/src/test/java/io/quarkus/it/openshift/client/OpenShiftClientTest.java index 3de0a0620e185..0398a7bb4bc0b 100644 --- a/integration-tests/openshift-client/src/test/java/io/quarkus/it/openshift/client/OpenShiftClientTest.java +++ b/integration-tests/openshift-client/src/test/java/io/quarkus/it/openshift/client/OpenShiftClientTest.java @@ -10,13 +10,13 @@ import io.fabric8.openshift.api.model.RouteBuilder; import io.fabric8.openshift.client.NamespacedOpenShiftClient; import io.fabric8.openshift.client.server.mock.OpenShiftMockServer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kubernetes.client.MockServer; import io.quarkus.test.kubernetes.client.OpenShiftMockServerTestResource; import io.restassured.RestAssured; -@WithTestResource(value = OpenShiftMockServerTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(OpenShiftMockServerTestResource.class) @QuarkusTest public class OpenShiftClientTest { diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/Db2OpenTelemetryJdbcInstrumentationTest.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/Db2OpenTelemetryJdbcInstrumentationTest.java index 51fd8f4898483..32c0e20389814 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/Db2OpenTelemetryJdbcInstrumentationTest.java +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/Db2OpenTelemetryJdbcInstrumentationTest.java @@ -3,12 +3,12 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @EnabledIfSystemProperty(named = "enable-db2", matches = "true") @QuarkusTest -@WithTestResource(Db2LifecycleManager.class) +@QuarkusTestResource(value = Db2LifecycleManager.class, restrictToAnnotatedClass = true) public class Db2OpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest { @Test diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/MariaDbOpenTelemetryJdbcInstrumentationTest.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/MariaDbOpenTelemetryJdbcInstrumentationTest.java index 74ab1437778a7..5034ac7e7c978 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/MariaDbOpenTelemetryJdbcInstrumentationTest.java +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/MariaDbOpenTelemetryJdbcInstrumentationTest.java @@ -2,11 +2,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(MariaDbLifecycleManager.class) +@QuarkusTestResource(value = MariaDbLifecycleManager.class, restrictToAnnotatedClass = true) public class MariaDbOpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest { @Test diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java index 7c74adc8d22f1..67e784bc1d457 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/OracleOpenTelemetryJdbcInstrumentationTest.java @@ -2,11 +2,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(OracleLifecycleManager.class) +@QuarkusTestResource(value = OracleLifecycleManager.class, restrictToAnnotatedClass = true) public class OracleOpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest { @Test diff --git a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/PostgresOpenTelemetryJdbcInstrumentationTest.java b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/PostgresOpenTelemetryJdbcInstrumentationTest.java index c3bafd0ea2153..cde8956e413eb 100644 --- a/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/PostgresOpenTelemetryJdbcInstrumentationTest.java +++ b/integration-tests/opentelemetry-jdbc-instrumentation/src/test/java/io/quarkus/it/opentelemetry/PostgresOpenTelemetryJdbcInstrumentationTest.java @@ -2,11 +2,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(PostgreSqlLifecycleManager.class) +@QuarkusTestResource(value = PostgreSqlLifecycleManager.class, restrictToAnnotatedClass = true) public class PostgresOpenTelemetryJdbcInstrumentationTest extends OpenTelemetryJdbcInstrumentationTest { @Test diff --git a/integration-tests/opentelemetry-mongodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java b/integration-tests/opentelemetry-mongodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java index ba082017a8d1c..59e74442f163f 100644 --- a/integration-tests/opentelemetry-mongodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java +++ b/integration-tests/opentelemetry-mongodb-client-instrumentation/src/test/java/io/quarkus/it/opentelemetry/BookResourceTest.java @@ -14,14 +14,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.mongodb.MongoTestResource; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = MongoTestResource.class, restrictToAnnotatedClass = false, initArgs = @ResourceArg(name = MongoTestResource.VERSION, value = "V6_0")) +@QuarkusTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.VERSION, value = "V6_0")) class BookResourceTest { private final TypeRef> bookListType = new TypeRef<>() { diff --git a/integration-tests/opentelemetry-reactive-messaging/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryTestCase.java b/integration-tests/opentelemetry-reactive-messaging/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryTestCase.java index 04c6c96932108..ab291d039192c 100644 --- a/integration-tests/opentelemetry-reactive-messaging/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryTestCase.java +++ b/integration-tests/opentelemetry-reactive-messaging/src/test/java/io/quarkus/it/opentelemetry/OpenTelemetryTestCase.java @@ -24,7 +24,7 @@ import io.opentelemetry.api.trace.SpanId; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.api.trace.TraceId; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.InjectKafkaCompanion; @@ -33,7 +33,7 @@ import io.smallrye.reactive.messaging.kafka.companion.KafkaCompanion; @QuarkusTest -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) public class OpenTelemetryTestCase { @TestHTTPResource("direct") URL directUrl; diff --git a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryWithSpanAtStartupTest.java b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryWithSpanAtStartupTest.java index 888e868d9fc91..b6fa9159bc6f8 100644 --- a/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryWithSpanAtStartupTest.java +++ b/integration-tests/opentelemetry-reactive/src/test/java/io/quarkus/it/opentelemetry/reactive/OpenTelemetryWithSpanAtStartupTest.java @@ -25,11 +25,11 @@ import io.opentelemetry.instrumentation.annotations.WithSpan; import io.quarkus.runtime.Startup; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; -@WithTestResource(OpenTelemetryWithSpanAtStartupTest.MyWireMockResource.class) +@QuarkusTestResource(restrictToAnnotatedClass = true, value = OpenTelemetryWithSpanAtStartupTest.MyWireMockResource.class) @QuarkusTest public class OpenTelemetryWithSpanAtStartupTest { diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSNoCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSNoCompressionTest.java index b7ee61e3e97eb..de67a1f1bae3a 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSNoCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSNoCompressionTest.java @@ -2,11 +2,11 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(OtelCollectorLifecycleManager.class) +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, restrictToAnnotatedClass = true) public class GrpcNoTLSNoCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSWithCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSWithCompressionTest.java index fc9ccc21722b8..facf170af3fc6 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSWithCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcNoTLSWithCompressionTest.java @@ -2,12 +2,12 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "enableCompression", value = "true")) +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "enableCompression", value = "true"), restrictToAnnotatedClass = true) public class GrpcNoTLSWithCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSNoCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSNoCompressionTest.java index 2e1b715f01d0f..b2420fd1b689b 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSNoCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSNoCompressionTest.java @@ -2,12 +2,12 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "enableTLS", value = "true")) +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "enableTLS", value = "true"), restrictToAnnotatedClass = true) public class GrpcWithTLSNoCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSWithCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSWithCompressionTest.java index 511d717ed5a4b..557c2f8f7f3a7 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSWithCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/grpc/GrpcWithTLSWithCompressionTest.java @@ -2,15 +2,15 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { @ResourceArg(name = "enableTLS", value = "true"), @ResourceArg(name = "enableCompression", value = "true") -}) +}, restrictToAnnotatedClass = true) public class GrpcWithTLSWithCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSNoCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSNoCompressionTest.java index 89e2479c49f14..60d5f0b70d2ec 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSNoCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSNoCompressionTest.java @@ -2,12 +2,12 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "protocol", value = "http/protobuf")) +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = @ResourceArg(name = "protocol", value = "http/protobuf"), restrictToAnnotatedClass = true) public class HttpNoTLSNoCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSWithCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSWithCompressionTest.java index a58624618e448..d9557d9aabe05 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSWithCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpNoTLSWithCompressionTest.java @@ -2,15 +2,15 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { @ResourceArg(name = "enableCompression", value = "true"), @ResourceArg(name = "protocol", value = "http/protobuf") -}) +}, restrictToAnnotatedClass = true) public class HttpNoTLSWithCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSNoCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSNoCompressionTest.java index 24a48d32a1129..78603ca32c5a3 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSNoCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSNoCompressionTest.java @@ -2,15 +2,15 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { @ResourceArg(name = "enableTLS", value = "true"), @ResourceArg(name = "protocol", value = "http/protobuf") -}) +}, restrictToAnnotatedClass = true) public class HttpWithTLSNoCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionTest.java index f9113e42f31cf..0f940eebae378 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionTest.java @@ -2,16 +2,16 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { @ResourceArg(name = "enableTLS", value = "true"), @ResourceArg(name = "enableCompression", value = "true"), @ResourceArg(name = "protocol", value = "http/protobuf") -}) +}, restrictToAnnotatedClass = true) public class HttpWithTLSWithCompressionTest extends AbstractExporterTest { } diff --git a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionUsingRegistryTest.java b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionUsingRegistryTest.java index 031930dd46b05..e00d9ca008237 100644 --- a/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionUsingRegistryTest.java +++ b/integration-tests/opentelemetry-vertx-exporter/src/test/java/io/quarkus/it/opentelemetry/vertx/exporter/http/HttpWithTLSWithCompressionUsingRegistryTest.java @@ -2,17 +2,17 @@ import io.quarkus.it.opentelemetry.vertx.exporter.AbstractExporterTest; import io.quarkus.it.opentelemetry.vertx.exporter.OtelCollectorLifecycleManager; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { +@QuarkusTestResource(value = OtelCollectorLifecycleManager.class, initArgs = { @ResourceArg(name = "enableTLS", value = "true"), @ResourceArg(name = "enableCompression", value = "true"), @ResourceArg(name = "protocol", value = "http/protobuf"), @ResourceArg(name = "tlsRegistryName", value = "otel") -}) +}, restrictToAnnotatedClass = true) public class HttpWithTLSWithCompressionUsingRegistryTest extends AbstractExporterTest { } diff --git a/integration-tests/picocli-native/src/test/java/io/quarkus/it/picocli/PicocliTest.java b/integration-tests/picocli-native/src/test/java/io/quarkus/it/picocli/PicocliTest.java index 75542f961f53d..c6264352148c8 100644 --- a/integration-tests/picocli-native/src/test/java/io/quarkus/it/picocli/PicocliTest.java +++ b/integration-tests/picocli-native/src/test/java/io/quarkus/it/picocli/PicocliTest.java @@ -8,15 +8,15 @@ import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.main.Launch; import io.quarkus.test.junit.main.LaunchResult; import io.quarkus.test.junit.main.QuarkusMainLauncher; import io.quarkus.test.junit.main.QuarkusMainTest; @QuarkusMainTest -@WithTestResource(value = PicocliTest.TestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(PicocliTest.TestResource.class) public class PicocliTest { private String value; diff --git a/integration-tests/quartz/src/test/java/io/quarkus/it/quartz/TestResources.java b/integration-tests/quartz/src/test/java/io/quarkus/it/quartz/TestResources.java index ac266eb5b96d5..ecc74f854233f 100644 --- a/integration-tests/quartz/src/test/java/io/quarkus/it/quartz/TestResources.java +++ b/integration-tests/quartz/src/test/java/io/quarkus/it/quartz/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.quartz; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/qute/src/test/java/io/quarkus/it/qute/TestResources.java b/integration-tests/qute/src/test/java/io/quarkus/it/qute/TestResources.java index 01ed2b66b77a5..5dbac2cb4c232 100644 --- a/integration-tests/qute/src/test/java/io/quarkus/it/qute/TestResources.java +++ b/integration-tests/qute/src/test/java/io/quarkus/it/qute/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.qute; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/reactive-messaging-amqp/src/test/java/io/quarkus/it/amqp/AmqpConnectorTest.java b/integration-tests/reactive-messaging-amqp/src/test/java/io/quarkus/it/amqp/AmqpConnectorTest.java index 62a18c1c35119..ee51e7d097f10 100644 --- a/integration-tests/reactive-messaging-amqp/src/test/java/io/quarkus/it/amqp/AmqpConnectorTest.java +++ b/integration-tests/reactive-messaging-amqp/src/test/java/io/quarkus/it/amqp/AmqpConnectorTest.java @@ -12,12 +12,12 @@ import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = AmqpBroker.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(AmqpBroker.class) @DisabledOnOs(OS.WINDOWS) public class AmqpConnectorTest { diff --git a/integration-tests/reactive-messaging-hibernate-orm/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java b/integration-tests/reactive-messaging-hibernate-orm/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java index 6942cf955f9fd..acad13994bca7 100644 --- a/integration-tests/reactive-messaging-hibernate-orm/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java +++ b/integration-tests/reactive-messaging-hibernate-orm/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java @@ -17,7 +17,7 @@ import io.quarkus.it.kafka.fruit.Fruit; import io.quarkus.it.kafka.people.PeopleState; import io.quarkus.it.kafka.people.Person; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.InjectKafkaCompanion; import io.quarkus.test.kafka.KafkaCompanionResource; @@ -26,7 +26,7 @@ import io.smallrye.reactive.messaging.kafka.companion.KafkaCompanion; @QuarkusTest -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) public class KafkaConnectorTest { protected static final TypeRef> TYPE_REF = new TypeRef>() { diff --git a/integration-tests/reactive-messaging-hibernate-reactive/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java b/integration-tests/reactive-messaging-hibernate-reactive/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java index 8711f2b66eb3c..0bb645727b28e 100644 --- a/integration-tests/reactive-messaging-hibernate-reactive/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java +++ b/integration-tests/reactive-messaging-hibernate-reactive/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java @@ -12,14 +12,14 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.KafkaCompanionResource; import io.restassured.common.mapper.TypeRef; import io.restassured.http.ContentType; @QuarkusTest -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) public class KafkaConnectorTest { protected static final TypeRef> FRUIT_TYPE_REF = new TypeRef>() { diff --git a/integration-tests/reactive-messaging-kafka/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java b/integration-tests/reactive-messaging-kafka/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java index 03a168c2efeeb..be548e8e26fd7 100644 --- a/integration-tests/reactive-messaging-kafka/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java +++ b/integration-tests/reactive-messaging-kafka/src/test/java/io/quarkus/it/kafka/KafkaConnectorTest.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.TestMethodOrder; import io.quarkus.arc.Arc; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.DisabledOnIntegrationTest; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.kafka.KafkaCompanionResource; @@ -26,7 +26,7 @@ import io.smallrye.reactive.messaging.kafka.commit.ProcessingState; @QuarkusTest -@WithTestResource(value = KafkaCompanionResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaCompanionResource.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class KafkaConnectorTest { diff --git a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/JksPulsarConnectorTest.java b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/JksPulsarConnectorTest.java index 12b2a10cebc24..5aee3c9fe8bf4 100644 --- a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/JksPulsarConnectorTest.java +++ b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/JksPulsarConnectorTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; -@WithTestResource(value = PulsarResource.class, initArgs = { +@QuarkusTestResource(value = PulsarResource.class, initArgs = { @ResourceArg(name = "isJks", value = "true"), @ResourceArg(name = "keyStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), @ResourceArg(name = "trustStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), diff --git a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PKCS12PulsarConnectorTest.java b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PKCS12PulsarConnectorTest.java index 01752dfaf78ef..e32ef0679580d 100644 --- a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PKCS12PulsarConnectorTest.java +++ b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PKCS12PulsarConnectorTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; -@WithTestResource(value = PulsarResource.class, initArgs = { +@QuarkusTestResource(value = PulsarResource.class, initArgs = { @ResourceArg(name = "isPem", value = "true"), @ResourceArg(name = "keyStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), @ResourceArg(name = "trustStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), diff --git a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PemPulsarConnectorTest.java b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PemPulsarConnectorTest.java index eda8d1c668f61..c9653ac1260c8 100644 --- a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PemPulsarConnectorTest.java +++ b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PemPulsarConnectorTest.java @@ -8,12 +8,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.ResourceArg; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; -@WithTestResource(value = PulsarResource.class, initArgs = { +@QuarkusTestResource(value = PulsarResource.class, initArgs = { @ResourceArg(name = "isPem", value = "true"), @ResourceArg(name = "keyStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), @ResourceArg(name = "trustStorePassword", value = "Z_pkTh9xgZovK4t34cGB2o6afT4zZg0L"), diff --git a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PulsarConnectorTest.java b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PulsarConnectorTest.java index 4b6a667db2978..bb9cc9f59ad12 100644 --- a/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PulsarConnectorTest.java +++ b/integration-tests/reactive-messaging-pulsar/src/test/java/io/quarkus/it/pulsar/PulsarConnectorTest.java @@ -8,11 +8,11 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; -@WithTestResource(value = PulsarResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(value = PulsarResource.class, restrictToAnnotatedClass = true) @QuarkusTest public class PulsarConnectorTest { diff --git a/integration-tests/reactive-messaging-rabbitmq-dyn/src/test/java/io/quarkus/it/rabbitmq/RabbitMQConnectorDynCredsTest.java b/integration-tests/reactive-messaging-rabbitmq-dyn/src/test/java/io/quarkus/it/rabbitmq/RabbitMQConnectorDynCredsTest.java index 057a0d8fa629f..eab9ad69c8765 100644 --- a/integration-tests/reactive-messaging-rabbitmq-dyn/src/test/java/io/quarkus/it/rabbitmq/RabbitMQConnectorDynCredsTest.java +++ b/integration-tests/reactive-messaging-rabbitmq-dyn/src/test/java/io/quarkus/it/rabbitmq/RabbitMQConnectorDynCredsTest.java @@ -15,13 +15,13 @@ import org.testcontainers.utility.DockerImageName; import io.quarkus.it.rabbitmq.RabbitMQConnectorDynCredsTest.RabbitMQResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import io.quarkus.test.common.WithTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.common.mapper.TypeRef; @QuarkusTest -@WithTestResource(value = RabbitMQResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(RabbitMQResource.class) public class RabbitMQConnectorDynCredsTest { public static class RabbitMQResource implements QuarkusTestResourceLifecycleManager { diff --git a/integration-tests/rest-client-reactive-stork/src/test/java/io/quarkus/it/rest/reactive/stork/RestClientReactiveStorkTest.java b/integration-tests/rest-client-reactive-stork/src/test/java/io/quarkus/it/rest/reactive/stork/RestClientReactiveStorkTest.java index fae294fca82f0..884d5ffbbfc0f 100644 --- a/integration-tests/rest-client-reactive-stork/src/test/java/io/quarkus/it/rest/reactive/stork/RestClientReactiveStorkTest.java +++ b/integration-tests/rest-client-reactive-stork/src/test/java/io/quarkus/it/rest/reactive/stork/RestClientReactiveStorkTest.java @@ -12,15 +12,15 @@ import io.quarkus.arc.Arc; import io.quarkus.it.rest.client.reactive.stork.MyServiceDiscoveryProvider; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.DisabledOnIntegrationTest; import io.quarkus.test.junit.QuarkusTest; import io.restassured.response.Response; import io.vertx.core.Vertx; @QuarkusTest -@WithTestResource(value = SlowWiremockServer.class, restrictToAnnotatedClass = false) -@WithTestResource(value = FastWiremockServer.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SlowWiremockServer.class) +@QuarkusTestResource(FastWiremockServer.class) public class RestClientReactiveStorkTest { @Test diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java index c8e3aa91bc7b3..38f20e638c796 100644 --- a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java +++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java @@ -6,12 +6,12 @@ import org.junit.jupiter.api.Test; import io.quarkus.it.rest.client.wronghost.BadHostServiceTestResource; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(SelfSignedServiceTestResource.class) -@WithTestResource(BadHostServiceTestResource.class) +@QuarkusTestResource(value = SelfSignedServiceTestResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(value = BadHostServiceTestResource.class, restrictToAnnotatedClass = true) public class ExternalSelfSignedTestCase { @Test diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java index 0987879317747..e7ce15c387e78 100644 --- a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java +++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java @@ -7,12 +7,12 @@ import org.junit.jupiter.api.Test; import io.quarkus.it.rest.client.selfsigned.SelfSignedServiceTestResource; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(SelfSignedServiceTestResource.class) -@WithTestResource(BadHostServiceTestResource.class) +@QuarkusTestResource(value = SelfSignedServiceTestResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(value = BadHostServiceTestResource.class, restrictToAnnotatedClass = true) public class ExternalWrongHostTestCase { @Test public void restClient() { diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java index 59d1acfcf74c0..3baf8b903301d 100644 --- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java +++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java @@ -5,11 +5,11 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(SelfSignedServiceTestResource.class) +@QuarkusTestResource(value = SelfSignedServiceTestResource.class, restrictToAnnotatedClass = true) public class ExternalSelfSignedTestCase { @Test diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java index 8c1f35ffdfa41..8fa1d7a225490 100644 --- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java +++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java @@ -5,12 +5,12 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(BadHostServiceTestResource.class) -@WithTestResource(value = ExternalTlsTrustAllTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(value = BadHostServiceTestResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(ExternalTlsTrustAllTestResource.class) public class ExternalTlsTrustAllTestCase { @Test diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java index 2d70f7da279c7..b436661d322bd 100644 --- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java +++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java @@ -1,11 +1,11 @@ package io.quarkus.it.rest.client.wronghost; import io.quarkus.it.rest.client.trustall.BadHostServiceTestResource; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(BadHostServiceTestResource.class) -@WithTestResource(ExternalWrongHostTestResourceUsingHostnameVerifier.class) +@QuarkusTestResource(value = BadHostServiceTestResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(value = ExternalWrongHostTestResourceUsingHostnameVerifier.class, restrictToAnnotatedClass = true) public class ExternalWrongHostUsingHostnameVerifierTestCase extends BaseExternalWrongHostTestCase { } diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java index bfd50dcb3e1ab..50401365a1183 100644 --- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java +++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java @@ -1,11 +1,11 @@ package io.quarkus.it.rest.client.wronghost; import io.quarkus.it.rest.client.trustall.BadHostServiceTestResource; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(BadHostServiceTestResource.class) -@WithTestResource(ExternalWrongHostTestResourceUsingVerifyHost.class) +@QuarkusTestResource(value = BadHostServiceTestResource.class, restrictToAnnotatedClass = true) +@QuarkusTestResource(value = ExternalWrongHostTestResourceUsingVerifyHost.class, restrictToAnnotatedClass = true) public class ExternalWrongHostUsingVerifyHostTestCase extends BaseExternalWrongHostTestCase { } diff --git a/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveMessagingTest.kt b/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveMessagingTest.kt index d6d67aac7e10a..07a2c65cbaa3a 100644 --- a/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveMessagingTest.kt +++ b/integration-tests/resteasy-reactive-kotlin/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/ReactiveMessagingTest.kt @@ -1,6 +1,6 @@ package io.quarkus.it.resteasy.reactive.kotlin -import io.quarkus.test.common.WithTestResource +import io.quarkus.test.common.QuarkusTestResource import io.quarkus.test.junit.QuarkusTest import io.restassured.RestAssured.get import io.restassured.common.mapper.TypeRef @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test @QuarkusTest -@WithTestResource(KafkaTestResource::class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KafkaTestResource::class) class ReactiveMessagingTest { private val TYPE_REF: TypeRef> = object : TypeRef>() {} diff --git a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/TestResources.java b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/TestResources.java index 80e04828a206b..0235b59982383 100644 --- a/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/TestResources.java +++ b/integration-tests/smallrye-context-propagation/src/test/java/io/quarkus/context/test/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.context.test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/smallrye-graphql-client-keycloak/src/test/java/io/quarkus/it/smallrye/graphql/keycloak/GraphQLAuthExpiryTest.java b/integration-tests/smallrye-graphql-client-keycloak/src/test/java/io/quarkus/it/smallrye/graphql/keycloak/GraphQLAuthExpiryTest.java index 0dd2ae9fefd27..01338e9915215 100644 --- a/integration-tests/smallrye-graphql-client-keycloak/src/test/java/io/quarkus/it/smallrye/graphql/keycloak/GraphQLAuthExpiryTest.java +++ b/integration-tests/smallrye-graphql-client-keycloak/src/test/java/io/quarkus/it/smallrye/graphql/keycloak/GraphQLAuthExpiryTest.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.http.TestHTTPResource; import io.quarkus.test.junit.QuarkusTest; @@ -14,7 +14,7 @@ * See `GraphQLClientTester` for the actual testing code that uses GraphQL clients. */ @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class GraphQLAuthExpiryTest { @TestHTTPResource diff --git a/integration-tests/smallrye-jwt-oidc-webapp/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtOidcWebAppTest.java b/integration-tests/smallrye-jwt-oidc-webapp/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtOidcWebAppTest.java index 9056400eb3cf8..45c4ab108d033 100644 --- a/integration-tests/smallrye-jwt-oidc-webapp/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtOidcWebAppTest.java +++ b/integration-tests/smallrye-jwt-oidc-webapp/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtOidcWebAppTest.java @@ -10,12 +10,12 @@ import org.htmlunit.html.HtmlPage; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class SmallRyeJwtOidcWebAppTest { @Test diff --git a/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java b/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java index 90161e7d78813..fce76b77d1d78 100644 --- a/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java +++ b/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/OidcTokenPropagationTest.java @@ -5,13 +5,13 @@ import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class OidcTokenPropagationTest { @Test diff --git a/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtGrpcAuthorizationTest.java b/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtGrpcAuthorizationTest.java index d9a43c07e41fa..1a22535d77209 100644 --- a/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtGrpcAuthorizationTest.java +++ b/integration-tests/smallrye-jwt-token-propagation/src/test/java/io/quarkus/it/keycloak/SmallRyeJwtGrpcAuthorizationTest.java @@ -3,12 +3,12 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; @QuarkusTest -@WithTestResource(value = KeycloakRealmResourceManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(KeycloakRealmResourceManager.class) public class SmallRyeJwtGrpcAuthorizationTest { @Test diff --git a/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/CommonAndTestProfilesTest.java b/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/CommonAndTestProfilesTest.java index a4148c5700910..c577f996119e1 100644 --- a/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/CommonAndTestProfilesTest.java +++ b/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/CommonAndTestProfilesTest.java @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = SpringCloudConfigServerResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SpringCloudConfigServerResource.class) @Tag("common") @Tag("test") public class CommonAndTestProfilesTest { diff --git a/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/OnlyTestProfileTest.java b/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/OnlyTestProfileTest.java index cd8b8f29eb11a..4956e277950bb 100644 --- a/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/OnlyTestProfileTest.java +++ b/integration-tests/spring-cloud-config-client/src/test/java/io/quarkus/spring/cloud/config/client/runtime/OnlyTestProfileTest.java @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest -@WithTestResource(value = SpringCloudConfigServerResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(SpringCloudConfigServerResource.class) @Tag("test") @Tag("test-only") public class OnlyTestProfileTest { diff --git a/integration-tests/spring-data-jpa/src/test/java/io/quarkus/it/spring/data/jpa/TestResources.java b/integration-tests/spring-data-jpa/src/test/java/io/quarkus/it/spring/data/jpa/TestResources.java index cbb8c056c615d..4ef6ba0fd6d7f 100644 --- a/integration-tests/spring-data-jpa/src/test/java/io/quarkus/it/spring/data/jpa/TestResources.java +++ b/integration-tests/spring-data-jpa/src/test/java/io/quarkus/it/spring/data/jpa/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.spring.data.jpa; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/spring-data-rest/src/test/java/io/quarkus/it/spring/data/rest/TestResources.java b/integration-tests/spring-data-rest/src/test/java/io/quarkus/it/spring/data/rest/TestResources.java index 63c81bf6a200e..b847c6bd2d916 100644 --- a/integration-tests/spring-data-rest/src/test/java/io/quarkus/it/spring/data/rest/TestResources.java +++ b/integration-tests/spring-data-rest/src/test/java/io/quarkus/it/spring/data/rest/TestResources.java @@ -1,8 +1,8 @@ package io.quarkus.it.spring.data.rest; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.h2.H2DatabaseTestResource; -@WithTestResource(value = H2DatabaseTestResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(H2DatabaseTestResource.class) public class TestResources { } diff --git a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResource.java b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResource.java index 5bcedc155de88..bd4c7d77ab7d4 100644 --- a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResource.java +++ b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResource.java @@ -7,11 +7,11 @@ import jakarta.enterprise.inject.Stereotype; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -@WithTestResource(value = LifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(LifecycleManager.class) @Stereotype public @interface CustomResource { diff --git a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResourceWithList.java b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResourceWithList.java index 7f25f4a671e89..ec818cef8840a 100644 --- a/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResourceWithList.java +++ b/integration-tests/test-extension/tests/src/test/java/io/quarkus/it/extension/CustomResourceWithList.java @@ -7,12 +7,12 @@ import jakarta.enterprise.inject.Stereotype; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -@WithTestResource.List({ - @WithTestResource(value = LifecycleManager.class, restrictToAnnotatedClass = false) +@QuarkusTestResource.List({ + @QuarkusTestResource(LifecycleManager.class) }) @Stereotype public @interface CustomResourceWithList { diff --git a/integration-tests/virtual-threads/amqp-virtual-threads/src/test/java/io/quarkus/it/vthreads/amqp/VirtualThreadTest.java b/integration-tests/virtual-threads/amqp-virtual-threads/src/test/java/io/quarkus/it/vthreads/amqp/VirtualThreadTest.java index 0ece61ecf1437..f78312ba795d5 100644 --- a/integration-tests/virtual-threads/amqp-virtual-threads/src/test/java/io/quarkus/it/vthreads/amqp/VirtualThreadTest.java +++ b/integration-tests/virtual-threads/amqp-virtual-threads/src/test/java/io/quarkus/it/vthreads/amqp/VirtualThreadTest.java @@ -11,13 +11,13 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.CountMatchingStrategy; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit5.virtual.ShouldNotPin; import io.quarkus.test.junit5.virtual.VirtualThreadUnit; @QuarkusTest -@WithTestResource(value = WireMockExtension.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(WireMockExtension.class) @VirtualThreadUnit @ShouldNotPin public class VirtualThreadTest { diff --git a/integration-tests/virtual-threads/jms-virtual-threads/src/test/java/io/quarkus/it/vthreads/jms/VirtualThreadTest.java b/integration-tests/virtual-threads/jms-virtual-threads/src/test/java/io/quarkus/it/vthreads/jms/VirtualThreadTest.java index 0c81d6b5747ab..39ebce8240846 100644 --- a/integration-tests/virtual-threads/jms-virtual-threads/src/test/java/io/quarkus/it/vthreads/jms/VirtualThreadTest.java +++ b/integration-tests/virtual-threads/jms-virtual-threads/src/test/java/io/quarkus/it/vthreads/jms/VirtualThreadTest.java @@ -11,13 +11,13 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.CountMatchingStrategy; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit5.virtual.ShouldNotPin; import io.quarkus.test.junit5.virtual.VirtualThreadUnit; @QuarkusTest -@WithTestResource(value = WireMockExtension.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(WireMockExtension.class) @VirtualThreadUnit @ShouldNotPin public class VirtualThreadTest { diff --git a/integration-tests/virtual-threads/kafka-virtual-threads/src/test/java/io/quarkus/it/vthreads/kafka/VirtualThreadTest.java b/integration-tests/virtual-threads/kafka-virtual-threads/src/test/java/io/quarkus/it/vthreads/kafka/VirtualThreadTest.java index 812d98962002b..ca5060e18aec1 100644 --- a/integration-tests/virtual-threads/kafka-virtual-threads/src/test/java/io/quarkus/it/vthreads/kafka/VirtualThreadTest.java +++ b/integration-tests/virtual-threads/kafka-virtual-threads/src/test/java/io/quarkus/it/vthreads/kafka/VirtualThreadTest.java @@ -11,13 +11,13 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.CountMatchingStrategy; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit5.virtual.ShouldNotPin; import io.quarkus.test.junit5.virtual.VirtualThreadUnit; @QuarkusTest -@WithTestResource(value = WireMockExtension.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(WireMockExtension.class) @VirtualThreadUnit @ShouldNotPin public class VirtualThreadTest { diff --git a/integration-tests/virtual-threads/mailer-virtual-threads/src/test/java/io/quarkus/virtual/mail/RunOnVirtualThreadTest.java b/integration-tests/virtual-threads/mailer-virtual-threads/src/test/java/io/quarkus/virtual/mail/RunOnVirtualThreadTest.java index 6e81fd521c911..659dc606b7e4a 100644 --- a/integration-tests/virtual-threads/mailer-virtual-threads/src/test/java/io/quarkus/virtual/mail/RunOnVirtualThreadTest.java +++ b/integration-tests/virtual-threads/mailer-virtual-threads/src/test/java/io/quarkus/virtual/mail/RunOnVirtualThreadTest.java @@ -6,7 +6,7 @@ import org.eclipse.microprofile.config.ConfigProvider; import org.junit.jupiter.api.Test; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit5.virtual.ShouldNotPin; import io.quarkus.test.junit5.virtual.VirtualThreadUnit; @@ -15,7 +15,7 @@ import io.vertx.core.json.JsonObject; @QuarkusTest -@WithTestResource(value = MailHogResource.class, restrictToAnnotatedClass = false) +@QuarkusTestResource(MailHogResource.class) @VirtualThreadUnit @ShouldNotPin class RunOnVirtualThreadTest { diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResource.java b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResource.java index 567b1ed21443f..a51e2ebb0be8e 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResource.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResource.java @@ -19,15 +19,11 @@ * started before any test is run. *

* Note that test resources are never restarted when running {@code @Nested} test classes. - * - * @deprecated Use the new {@link WithTestResource} instead. It will be a long while before this is removed, but better to move - * to the replacement sooner than later. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Repeatable(List.class) -@Deprecated(forRemoval = true) public @interface QuarkusTestResource { /** @@ -52,8 +48,8 @@ * Note that this defaults to true for meta-annotations since meta-annotations are only considered * for the current test class or test profile. *

- * Note: When this is set to {@code true} (which is the default), the annotation {@code @WithTestResource} will result - * in the application being re-augmented and restarted (in a similar fashion as happens in dev-mode when a change is + * Note: When this is set to {@code true}, the annotation {@code @QuarkusTestResource} will result + * in the application being re-augmented and restarted (in a similar fashion as happens in dev mode when a change is * detected). */ boolean restrictToAnnotatedClass() default false; @@ -61,7 +57,6 @@ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented - @Deprecated(forRemoval = true) @interface List { QuarkusTestResource[] value(); } diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceLifecycleManager.java b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceLifecycleManager.java index a5f9ed3ce3f5e..7c95b3aaa253f 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceLifecycleManager.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceLifecycleManager.java @@ -9,7 +9,7 @@ * Manage the lifecycle of a test resource, for instance a H2 test server. *

* These resources are started before the first test is run, and are closed - * at the end of the test suite. They are configured via the {@link WithTestResource} + * at the end of the test suite. They are configured via the {@link QuarkusTestResource} * annotation, which can be placed on any class in the test suite. * * These can also be loaded via a service loader mechanism, however if a service @@ -55,7 +55,7 @@ default void setContext(Context context) { * * The {@code args} is never null * - * @see WithTestResource#initArgs() + * @see QuarkusTestResource#initArgs() */ default void init(Map initArgs) { diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceRepeatable.java b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceRepeatable.java index 2398d6a0f89ba..859a863e272e3 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceRepeatable.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/QuarkusTestResourceRepeatable.java @@ -11,15 +11,10 @@ * Used to indicate the type of the repeatable annotation * type annotated with a {@code QuarkusTestResource} annotations. * - *

- * - * @deprecated Use {@link WithTestResourceRepeatable} instead - *

*/ @Target(ElementType.ANNOTATION_TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented -@Deprecated(forRemoval = true) public @interface QuarkusTestResourceRepeatable { /** diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/ResourceArg.java b/test-framework/common/src/main/java/io/quarkus/test/common/ResourceArg.java index fd4bdd7db6a91..feec0413ab642 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/ResourceArg.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/ResourceArg.java @@ -6,9 +6,9 @@ import java.lang.annotation.Target; /** - * Uses to define arguments for {@code WithTestResource} + * Used to define arguments for {@code QuarkusTestResource}. * - * see {@link WithTestResource#initArgs()} + * see {@link QuarkusTestResource#initArgs()} */ @Target({}) @Retention(RetentionPolicy.RUNTIME) diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/WithTestResource.java b/test-framework/common/src/main/java/io/quarkus/test/common/WithTestResource.java index efd1372f8e396..a891640e1ae3d 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/WithTestResource.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/WithTestResource.java @@ -13,6 +13,10 @@ /** * Used to define a test resource, which can affect various aspects of the application lifecycle. *

+ * WARNING: this annotation, introduced in 3.13, caused some issues so it was decided to undeprecate + * {@link QuarkusTestResource} and rework the behavior of this annotation. For now, we recommend not using it + * until we improve its behavior. + *

* Note: When using the {@code restrictToAnnotatedClass=true} (which is the default), each test that is annotated * with {@code @WithTestResource} will result in the application being re-augmented and restarted (in a similar fashion * as happens in dev-mode when a change is detected) in order to incorporate the settings configured by the annotation. @@ -25,7 +29,7 @@ *

* Note that test resources are never restarted when running {@code @Nested} test classes. *

- * This replaces {@link QuarkusTestResource}. The only difference is that the default value for + * The only difference with {@link QuarkusTestResource} is that the default value for * {@link #restrictToAnnotatedClass()} {@code == true}. *

*

diff --git a/test-framework/google-cloud-functions/src/main/java/io/quarkus/google/cloud/functions/test/WithFunction.java b/test-framework/google-cloud-functions/src/main/java/io/quarkus/google/cloud/functions/test/WithFunction.java index 0e395b5cc5812..22296fc1d17c8 100644 --- a/test-framework/google-cloud-functions/src/main/java/io/quarkus/google/cloud/functions/test/WithFunction.java +++ b/test-framework/google-cloud-functions/src/main/java/io/quarkus/google/cloud/functions/test/WithFunction.java @@ -5,7 +5,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; /** * This annotation can be used to start a Google Cloud Function for a test. @@ -15,7 +15,7 @@ * * @see CloudFunctionTestResource */ -@WithTestResource(CloudFunctionTestResource.class) +@QuarkusTestResource(value = CloudFunctionTestResource.class, restrictToAnnotatedClass = true) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface WithFunction { diff --git a/test-framework/junit5-internal/src/main/java/io/quarkus/test/LogCollectingTestResource.java b/test-framework/junit5-internal/src/main/java/io/quarkus/test/LogCollectingTestResource.java index e018888b18118..ea756df682782 100644 --- a/test-framework/junit5-internal/src/main/java/io/quarkus/test/LogCollectingTestResource.java +++ b/test-framework/junit5-internal/src/main/java/io/quarkus/test/LogCollectingTestResource.java @@ -34,7 +34,7 @@ public static String format(LogRecord record) { public static LogCollectingTestResource current() { if (current == null) { throw new IllegalStateException( - LogCollectingTestResource.class.getName() + " must be registered with @WithTestResource"); + LogCollectingTestResource.class.getName() + " must be registered with @QuarkusTestResource"); } return current; } diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusTestProfile.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusTestProfile.java index 46b11de971cf3..6b64d87733a4b 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusTestProfile.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusTestProfile.java @@ -51,7 +51,7 @@ default String getConfigProfile() { * specific test profile. * * If this method is not overridden, then only the {@link QuarkusTestResourceLifecycleManager} classes enabled via the - * {@link io.quarkus.test.common.WithTestResource} class + * {@link io.quarkus.test.common.QuarkusTestResource} class * annotation will be used for the tests using this profile (which is the same behavior as tests that don't use a profile at * all). */ diff --git a/test-framework/kubernetes-client/src/main/java/io/quarkus/test/kubernetes/client/WithKubernetesTestServer.java b/test-framework/kubernetes-client/src/main/java/io/quarkus/test/kubernetes/client/WithKubernetesTestServer.java index 1edcb1fd20a54..a9dc203a100ef 100644 --- a/test-framework/kubernetes-client/src/main/java/io/quarkus/test/kubernetes/client/WithKubernetesTestServer.java +++ b/test-framework/kubernetes-client/src/main/java/io/quarkus/test/kubernetes/client/WithKubernetesTestServer.java @@ -7,13 +7,13 @@ import java.util.function.Consumer; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; /** * Use on your test resource to get a mock {@link KubernetesServer} spawn up, and injectable with {@link KubernetesTestServer}. * This annotation is only active when used on a test class, and only for this test class. */ -@WithTestResource(KubernetesServerTestResource.class) +@QuarkusTestResource(value = KubernetesServerTestResource.class, restrictToAnnotatedClass = true) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface WithKubernetesTestServer { diff --git a/test-framework/oidc-server/src/test/java/io/quarkus/test/oidc/server/OidcWiremockTestResourceInjectionTest.java b/test-framework/oidc-server/src/test/java/io/quarkus/test/oidc/server/OidcWiremockTestResourceInjectionTest.java index 953de58f61c87..e0d77f7ccb806 100644 --- a/test-framework/oidc-server/src/test/java/io/quarkus/test/oidc/server/OidcWiremockTestResourceInjectionTest.java +++ b/test-framework/oidc-server/src/test/java/io/quarkus/test/oidc/server/OidcWiremockTestResourceInjectionTest.java @@ -6,8 +6,8 @@ import com.github.tomakehurst.wiremock.WireMockServer; +import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.common.TestResourceManager; -import io.quarkus.test.common.WithTestResource; /** * Validates the injection of {@link WireMockServer} objects into test instances by {@link OidcWiremockTestResource}. @@ -24,7 +24,7 @@ void testWireMockServerInjection() { assertNotNull(test.server); } - @WithTestResource(value = OidcWiremockTestResource.class, restrictToAnnotatedClass = false) + @QuarkusTestResource(OidcWiremockTestResource.class) public static class CustomTest { @OidcWireMock WireMockServer server; diff --git a/test-framework/openshift-client/src/main/java/io/quarkus/test/kubernetes/client/WithOpenShiftTestServer.java b/test-framework/openshift-client/src/main/java/io/quarkus/test/kubernetes/client/WithOpenShiftTestServer.java index a140a36bca874..9d978bdd8c0a9 100644 --- a/test-framework/openshift-client/src/main/java/io/quarkus/test/kubernetes/client/WithOpenShiftTestServer.java +++ b/test-framework/openshift-client/src/main/java/io/quarkus/test/kubernetes/client/WithOpenShiftTestServer.java @@ -7,13 +7,13 @@ import java.util.function.Consumer; import io.fabric8.openshift.client.server.mock.OpenShiftServer; -import io.quarkus.test.common.WithTestResource; +import io.quarkus.test.common.QuarkusTestResource; /** * Use on your test resource to get a mock {@link OpenShiftServer} spawn up, and injectable with {@link OpenShiftTestServer}. * This annotation is only active when used on a test class, and only for this test class. */ -@WithTestResource(OpenShiftServerTestResource.class) +@QuarkusTestResource(value = OpenShiftServerTestResource.class, restrictToAnnotatedClass = true) @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface WithOpenShiftTestServer { From 982fc7811014664ea74b471cb08b785605c95d7f Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 27 Aug 2024 13:19:22 +0300 Subject: [PATCH 16/17] Fix logging categories doc example Closes: #42166 (cherry picked from commit def257cc92ced3174473004bb14d3cec99cbe537) --- docs/src/main/asciidoc/logging.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/logging.adoc b/docs/src/main/asciidoc/logging.adoc index bb2bd14698df9..8c9f685c13194 100644 --- a/docs/src/main/asciidoc/logging.adoc +++ b/docs/src/main/asciidoc/logging.adoc @@ -255,10 +255,13 @@ This includes the globally configured handlers and formatters. ==== [source, properties] ---- -quarkus.log.handlers=console,mylog +quarkus.log.handlers=con,mylog + +quarkus.log.handler.console.con.enable=true +quarkus.log.handler.file.mylog.enable=true ---- -In this example, the root category is configured to use two handlers: `console` and `mylog`. +In this example, the root category is configured to use two named handlers: `con` and `mylog`. ==== .An example of a per-category configuration: From c48cb11729d3a23cba8c3fe1c0e48c9ec4545286 Mon Sep 17 00:00:00 2001 From: Jan Martiska Date: Tue, 27 Aug 2024 14:33:35 +0200 Subject: [PATCH 17/17] Upgrade to SmallRye GraphQL 2.9.2 (cherry picked from commit 83d6540c110c60c0ae6ec92e74f05fa2522a41c6) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index 36c95bf899120..a561889a9b249 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -55,7 +55,7 @@ 4.1.0 4.0.0 3.10.0 - 2.9.1 + 2.9.2 6.4.0 4.5.3 2.1.2