diff --git a/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java b/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java index 0598b760cde..73d862c0205 100644 --- a/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java +++ b/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java @@ -99,6 +99,15 @@ class TestContextRuntimeHints implements RuntimeHintsRegistrar { // Application Events org.springframework.test.context.event.RecordApplicationEvents.class, + // Test execution events + org.springframework.test.context.event.annotation.AfterTestClass.class, + org.springframework.test.context.event.annotation.AfterTestExecution.class, + org.springframework.test.context.event.annotation.AfterTestMethod.class, + org.springframework.test.context.event.annotation.BeforeTestClass.class, + org.springframework.test.context.event.annotation.BeforeTestExecution.class, + org.springframework.test.context.event.annotation.BeforeTestMethod.class, + org.springframework.test.context.event.annotation.PrepareTestInstance.class, + // JUnit Jupiter org.springframework.test.context.junit.jupiter.EnabledIf.class, org.springframework.test.context.junit.jupiter.DisabledIf.class, diff --git a/spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java b/spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java index 9f1bfbc1639..148fc58f4a1 100644 --- a/spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/aot/TestContextAotGeneratorTests.java @@ -153,6 +153,15 @@ class TestContextAotGeneratorTests extends AbstractAotTests { // Application Events org.springframework.test.context.event.RecordApplicationEvents.class, + // Test execution events + org.springframework.test.context.event.annotation.AfterTestClass.class, + org.springframework.test.context.event.annotation.AfterTestExecution.class, + org.springframework.test.context.event.annotation.AfterTestMethod.class, + org.springframework.test.context.event.annotation.BeforeTestClass.class, + org.springframework.test.context.event.annotation.BeforeTestExecution.class, + org.springframework.test.context.event.annotation.BeforeTestMethod.class, + org.springframework.test.context.event.annotation.PrepareTestInstance.class, + // JUnit Jupiter org.springframework.test.context.junit.jupiter.EnabledIf.class, org.springframework.test.context.junit.jupiter.DisabledIf.class,