From 49b058cce3e116dd65612128ffb631fb653dd394 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Thu, 22 Aug 2024 12:33:48 +0200 Subject: [PATCH] Add a lot more info to the QuarkusTestResource deprecation note --- .../java/io/quarkus/test/common/QuarkusTestResource.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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..7b5205a61d041 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 @@ -20,8 +20,13 @@ *

* 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. + * @deprecated Use the new {@link WithTestResource} instead. Be careful, {@link WithTestResource} doesn't have the same behavior + * by default and you might want to set {@code restrictToAnnotatedClass} to {@code false} to keep your current + * behavior. If you don't, the test resource will be local to the annotated test and Quarkus will be restarted for + * each annotated test. While it is a saner behavior in general, it might not be what you want for your project if + * the default behavior of {@code QuarkusTestResource} was fine for you. + * Please see the Quarkus 3.13 migration + * guide for more information. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)