22
22
import org .junit .jupiter .api .AfterEach ;
23
23
import org .junit .jupiter .api .Nested ;
24
24
import org .junit .jupiter .api .Test ;
25
+ import org .junit .jupiter .api .extension .ExtendWith ;
25
26
26
- import org .springframework .context .annotation .Configuration ;
27
27
import org .springframework .test .context .NestedTestConfiguration ;
28
28
import org .springframework .test .context .TestContext ;
29
29
import org .springframework .test .context .TestExecutionListeners ;
30
+ import org .springframework .test .context .aot .DisabledInAotMode ;
30
31
import org .springframework .test .context .junit .jupiter .SpringExtension ;
31
- import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
32
32
import org .springframework .test .context .junit .jupiter .nested .TestExecutionListenersNestedTests .FooTestExecutionListener ;
33
33
import org .springframework .test .context .support .AbstractTestExecutionListener ;
34
34
44
44
* @author Sam Brannen
45
45
* @since 5.3
46
46
*/
47
- @ SpringJUnitConfig
47
+ @ ExtendWith ( SpringExtension . class )
48
48
@ TestExecutionListeners (FooTestExecutionListener .class )
49
49
@ NestedTestConfiguration (OVERRIDE ) // since INHERIT is now the global default
50
+ // Since this test class does not load an ApplicationContext,
51
+ // this test class simply is not supported for AOT processing.
52
+ @ DisabledInAotMode
50
53
class TestExecutionListenersNestedTests {
51
54
52
55
private static final String FOO = "foo" ;
@@ -79,8 +82,8 @@ void test() {
79
82
}
80
83
81
84
@ Nested
82
- @ SpringJUnitConfig (Config .class )
83
85
@ TestExecutionListeners (BarTestExecutionListener .class )
86
+ @ DisabledInAotMode
84
87
class ConfigOverriddenByDefaultTests {
85
88
86
89
@ Test
@@ -91,7 +94,6 @@ void test() {
91
94
92
95
@ Nested
93
96
@ NestedTestConfiguration (INHERIT )
94
- @ SpringJUnitConfig (Config .class )
95
97
@ TestExecutionListeners (BarTestExecutionListener .class )
96
98
class InheritedAndExtendedConfigTests {
97
99
@@ -103,8 +105,8 @@ void test() {
103
105
104
106
@ Nested
105
107
@ NestedTestConfiguration (OVERRIDE )
106
- @ SpringJUnitConfig (Config .class )
107
108
@ TestExecutionListeners (BazTestExecutionListener .class )
109
+ @ DisabledInAotMode
108
110
class DoubleNestedWithOverriddenConfigTests {
109
111
110
112
@ Test
@@ -139,11 +141,6 @@ void test() {
139
141
140
142
// -------------------------------------------------------------------------
141
143
142
- @ Configuration
143
- static class Config {
144
- /* no user beans required for these tests */
145
- }
146
-
147
144
private abstract static class BaseTestExecutionListener extends AbstractTestExecutionListener {
148
145
149
146
protected abstract String name ();
0 commit comments