>() {}
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 {