Skip to content

Commit bb95f2e

Browse files
committed
Apply @⁠DisabledInAotMode to @⁠ContextHierarchy integration tests
This commit applies @⁠DisabledInAotMode to all integration test classes in the spring-test module that use @⁠ContextHierarchy since that feature is not supported for AOT optimizations. Current AOT test results for the spring-test module: Test run finished after 6888 ms [ 403 containers found ] [ 57 containers skipped ] [ 346 containers started ] [ 0 containers aborted ] [ 338 containers successful ] [ 8 containers failed ] [ 757 tests found ] [ 98 tests skipped ] [ 654 tests started ] [ 9 tests aborted ] [ 576 tests successful ] [ 69 tests failed ] Failing Test Classes: org.springframework.test.context.configuration.interfaces.SqlConfigInterfaceTests org.springframework.test.context.expression.ExpressionUsageTests org.springframework.test.context.groovy.AbsolutePathGroovySpringContextTests org.springframework.test.context.groovy.GroovySpringContextTests org.springframework.test.context.groovy.RelativePathGroovySpringContextTests org.springframework.test.context.hierarchies.meta.MetaHierarchyLevelTwoTests org.springframework.test.context.hierarchies.standard.TestHierarchyLevelTwoWithBareContextConfigurationInSubclassTests org.springframework.test.context.jdbc.CustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.GlobalCustomScriptSyntaxSqlScriptsTests org.springframework.test.context.jdbc.InferredDataSourceTransactionalSqlScriptsTests org.springframework.test.context.jdbc.InfrastructureProxyTransactionalSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersSqlScriptsTests org.springframework.test.context.jdbc.MultipleDataSourcesAndTransactionManagersTransactionalSqlScriptsTests org.springframework.test.context.jdbc.NonTransactionalSqlScriptsTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsChildTests org.springframework.test.context.jdbc.RepeatableSqlAnnotationSqlScriptsParentTests org.springframework.test.context.jdbc.TransactionalAfterTestMethodSqlScriptsTests org.springframework.test.context.jdbc.TransactionalInlinedStatementsSqlScriptsTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$ConfigOverriddenByDefaultTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests org.springframework.test.context.junit.jupiter.nested.TestExecutionListenersNestedTests$InheritedAndExtendedConfigTests$DoubleNestedWithOverriddenConfigTests$TripleNestedWithInheritedConfigAndTestInterfaceTests org.springframework.test.context.junit.jupiter.orm.JpaEntityListenerTests org.springframework.test.context.junit4.AbsolutePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ClassPathResourceSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ConcreteTransactionalJUnit4SpringContextTests org.springframework.test.context.junit4.InheritedConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.MultipleResourcesSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.ParameterizedDependencyInjectionTests org.springframework.test.context.junit4.RelativePathSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.SpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.annotation.AnnotationConfigSpringJUnit4ClassRunnerAppCtxTests org.springframework.test.context.junit4.rules.TransactionalSqlScriptsSpringRuleTests org.springframework.test.context.junit4.spr9799.Spr9799XmlConfigTests org.springframework.test.context.testng.ConcreteTransactionalTestNGSpringContextTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.CommitForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiredEjbTxDaoTestNGTests org.springframework.test.context.testng.transaction.ejb.RollbackForRequiresNewEjbTxDaoTestNGTests org.springframework.test.context.transaction.ejb.CommitForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.CommitForRequiresNewEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiredEjbTxDaoTests org.springframework.test.context.transaction.ejb.RollbackForRequiresNewEjbTxDaoTests See gh-29122
1 parent 44931dc commit bb95f2e

26 files changed

+74
-23
lines changed

Diff for: spring-test/src/test/java/org/springframework/test/context/configuration/interfaces/ContextHierarchyInterfaceTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121

2222
import org.springframework.beans.factory.annotation.Autowired;
2323
import org.springframework.context.ApplicationContext;
24+
import org.springframework.test.context.aot.DisabledInAotMode;
2425
import org.springframework.test.context.junit.jupiter.SpringExtension;
2526

2627
import static org.assertj.core.api.Assertions.assertThat;
@@ -30,6 +31,7 @@
3031
* @since 4.3
3132
*/
3233
@ExtendWith(SpringExtension.class)
34+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3335
class ContextHierarchyInterfaceTests implements ContextHierarchyTestInterface {
3436

3537
@Autowired

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/meta/MetaHierarchyLevelOneTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import org.junit.jupiter.api.extension.ExtendWith;
2121

2222
import org.springframework.beans.factory.annotation.Autowired;
23+
import org.springframework.test.context.aot.DisabledInAotMode;
2324
import org.springframework.test.context.junit.jupiter.SpringExtension;
2425

2526
import static org.assertj.core.api.Assertions.assertThat;
@@ -30,6 +31,7 @@
3031
*/
3132
@ExtendWith(SpringExtension.class)
3233
@MetaMetaContextHierarchyConfig
34+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3335
class MetaHierarchyLevelOneTests {
3436

3537
@Autowired

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/ClassHierarchyWithMergedConfigLevelOneTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
import org.springframework.context.annotation.Configuration;
2727
import org.springframework.test.context.ContextConfiguration;
2828
import org.springframework.test.context.ContextHierarchy;
29+
import org.springframework.test.context.aot.DisabledInAotMode;
2930
import org.springframework.test.context.junit.jupiter.SpringExtension;
3031

3132
import static org.assertj.core.api.Assertions.assertThat;
@@ -40,6 +41,7 @@
4041
@ContextConfiguration(name = "parent", classes = ClassHierarchyWithMergedConfigLevelOneTests.AppConfig.class),//
4142
@ContextConfiguration(name = "child", classes = ClassHierarchyWithMergedConfigLevelOneTests.UserConfig.class) //
4243
})
44+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
4345
class ClassHierarchyWithMergedConfigLevelOneTests {
4446

4547
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/ClassHierarchyWithMergedConfigLevelTwoTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
2424
import org.springframework.context.annotation.Configuration;
2525
import org.springframework.test.context.ContextConfiguration;
2626
import org.springframework.test.context.ContextHierarchy;
27+
import org.springframework.test.context.aot.DisabledInAotMode;
2728
import org.springframework.test.context.junit.jupiter.SpringExtension;
2829

2930
import static org.assertj.core.api.Assertions.assertThat;
@@ -34,6 +35,7 @@
3435
*/
3536
@ExtendWith(SpringExtension.class)
3637
@ContextHierarchy(@ContextConfiguration(name = "child", classes = ClassHierarchyWithMergedConfigLevelTwoTests.OrderConfig.class))
38+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3739
class ClassHierarchyWithMergedConfigLevelTwoTests extends ClassHierarchyWithMergedConfigLevelOneTests {
3840

3941
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/ClassHierarchyWithOverriddenConfigLevelTwoTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
2424
import org.springframework.context.annotation.Configuration;
2525
import org.springframework.test.context.ContextConfiguration;
2626
import org.springframework.test.context.ContextHierarchy;
27+
import org.springframework.test.context.aot.DisabledInAotMode;
2728
import org.springframework.test.context.junit.jupiter.SpringExtension;
2829

2930
import static org.assertj.core.api.Assertions.assertThat;
@@ -34,6 +35,7 @@
3435
*/
3536
@ExtendWith(SpringExtension.class)
3637
@ContextHierarchy(@ContextConfiguration(name = "child", classes = ClassHierarchyWithOverriddenConfigLevelTwoTests.TestUserConfig.class, inheritLocations = false))
38+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3739
class ClassHierarchyWithOverriddenConfigLevelTwoTests extends ClassHierarchyWithMergedConfigLevelOneTests {
3840

3941
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/DirtiesContextWithContextHierarchyTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@
3131
import org.springframework.test.annotation.DirtiesContext.HierarchyMode;
3232
import org.springframework.test.context.ContextConfiguration;
3333
import org.springframework.test.context.ContextHierarchy;
34+
import org.springframework.test.context.aot.DisabledInAotMode;
3435
import org.springframework.test.context.junit.jupiter.SpringExtension;
3536

3637
import static org.assertj.core.api.Assertions.assertThat;
@@ -51,6 +52,7 @@
5152
@ContextConfiguration(classes = DirtiesContextWithContextHierarchyTests.ChildConfig.class)
5253
})
5354
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
55+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
5456
class DirtiesContextWithContextHierarchyTests {
5557

5658
@Autowired

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/SingleTestClassWithSingleLevelContextHierarchyTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +36,7 @@
3536
*/
3637
@ExtendWith(SpringExtension.class)
3738
@ContextHierarchy(@ContextConfiguration)
39+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3840
class SingleTestClassWithSingleLevelContextHierarchyTests {
3941

4042
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/SingleTestClassWithTwoLevelContextHierarchyAndMixedConfigTypesTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -37,6 +38,7 @@
3738
@ContextHierarchy({
3839
@ContextConfiguration(classes = SingleTestClassWithTwoLevelContextHierarchyAndMixedConfigTypesTests.ParentConfig.class),
3940
@ContextConfiguration("SingleTestClassWithTwoLevelContextHierarchyAndMixedConfigTypesTests-ChildConfig.xml") })
41+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
4042
class SingleTestClassWithTwoLevelContextHierarchyAndMixedConfigTypesTests {
4143

4244
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/SingleTestClassWithTwoLevelContextHierarchyTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -37,6 +38,7 @@
3738
@ContextHierarchy({
3839
@ContextConfiguration(classes = SingleTestClassWithTwoLevelContextHierarchyTests.ParentConfig.class),
3940
@ContextConfiguration(classes = SingleTestClassWithTwoLevelContextHierarchyTests.ChildConfig.class) })
41+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
4042
public class SingleTestClassWithTwoLevelContextHierarchyTests {
4143

4244
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/TestHierarchyLevelOneWithBareContextConfigurationInSubclassTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +36,7 @@
3536
*/
3637
@ExtendWith(SpringExtension.class)
3738
@ContextHierarchy(@ContextConfiguration)
39+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3840
class TestHierarchyLevelOneWithBareContextConfigurationInSubclassTests {
3941

4042
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/TestHierarchyLevelOneWithSingleLevelContextHierarchyTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +36,7 @@
3536
*/
3637
@ExtendWith(SpringExtension.class)
3738
@ContextHierarchy(@ContextConfiguration)
39+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3840
class TestHierarchyLevelOneWithSingleLevelContextHierarchyTests {
3941

4042
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/TestHierarchyLevelTwoWithBareContextConfigurationInSuperclassTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +36,7 @@
3536
*/
3637
@ExtendWith(SpringExtension.class)
3738
@ContextHierarchy(@ContextConfiguration)
39+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3840
class TestHierarchyLevelTwoWithBareContextConfigurationInSuperclassTests extends
3941
TestHierarchyLevelOneWithBareContextConfigurationInSuperclassTests {
4042

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/TestHierarchyLevelTwoWithSingleLevelContextHierarchyAndMixedConfigTypesTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import org.springframework.context.ApplicationContext;
2424
import org.springframework.test.context.ContextConfiguration;
2525
import org.springframework.test.context.ContextHierarchy;
26+
import org.springframework.test.context.aot.DisabledInAotMode;
2627
import org.springframework.test.context.junit.jupiter.SpringExtension;
2728

2829
import static org.assertj.core.api.Assertions.assertThat;
@@ -33,6 +34,7 @@
3334
*/
3435
@ExtendWith(SpringExtension.class)
3536
@ContextHierarchy(@ContextConfiguration)
37+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3638
class TestHierarchyLevelTwoWithSingleLevelContextHierarchyAndMixedConfigTypesTests extends
3739
TestHierarchyLevelOneWithSingleLevelContextHierarchyTests {
3840

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/standard/TestHierarchyLevelTwoWithSingleLevelContextHierarchyTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.junit.jupiter.SpringExtension;
2930

3031
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,6 +36,7 @@
3536
*/
3637
@ExtendWith(SpringExtension.class)
3738
@ContextHierarchy(@ContextConfiguration)
39+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3840
class TestHierarchyLevelTwoWithSingleLevelContextHierarchyTests extends
3941
TestHierarchyLevelOneWithSingleLevelContextHierarchyTests {
4042

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/web/ControllerIntegrationTests.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
import org.springframework.context.annotation.Configuration;
2727
import org.springframework.test.context.ContextConfiguration;
2828
import org.springframework.test.context.ContextHierarchy;
29+
import org.springframework.test.context.aot.DisabledInAotMode;
2930
import org.springframework.test.context.hierarchies.web.ControllerIntegrationTests.AppConfig;
3031
import org.springframework.test.context.hierarchies.web.ControllerIntegrationTests.WebConfig;
3132
import org.springframework.test.context.junit.jupiter.SpringExtension;
@@ -41,10 +42,10 @@
4142
@ExtendWith(SpringExtension.class)
4243
@WebAppConfiguration
4344
@ContextHierarchy({
44-
//
4545
@ContextConfiguration(name = "root", classes = AppConfig.class),
46-
@ContextConfiguration(name = "dispatcher", classes = WebConfig.class) //
46+
@ContextConfiguration(name = "dispatcher", classes = WebConfig.class)
4747
})
48+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
4849
class ControllerIntegrationTests {
4950

5051
@Configuration

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/web/DispatcherWacRootWacEarTests.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
2424
import org.springframework.context.ApplicationContext;
2525
import org.springframework.test.context.ContextConfiguration;
2626
import org.springframework.test.context.ContextHierarchy;
27+
import org.springframework.test.context.aot.DisabledInAotMode;
2728
import org.springframework.web.context.WebApplicationContext;
2829

2930
import static org.assertj.core.api.Assertions.assertThat;
@@ -33,6 +34,7 @@
3334
* @since 3.2.2
3435
*/
3536
@ContextHierarchy(@ContextConfiguration)
37+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3638
public class DispatcherWacRootWacEarTests extends RootWacEarTests {
3739

3840
@Autowired

Diff for: spring-test/src/test/java/org/springframework/test/context/hierarchies/web/RootWacEarTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.springframework.context.annotation.Configuration;
2626
import org.springframework.test.context.ContextConfiguration;
2727
import org.springframework.test.context.ContextHierarchy;
28+
import org.springframework.test.context.aot.DisabledInAotMode;
2829
import org.springframework.test.context.web.WebAppConfiguration;
2930
import org.springframework.web.context.WebApplicationContext;
3031

@@ -36,6 +37,7 @@
3637
*/
3738
@WebAppConfiguration
3839
@ContextHierarchy(@ContextConfiguration)
40+
@DisabledInAotMode // @ContextHierarchy is not supported in AOT.
3941
class RootWacEarTests extends EarTests {
4042

4143
@Configuration(proxyBeanMethods = false)

0 commit comments

Comments
 (0)