Skip to content

Commit 59eaed0

Browse files
committed
Ensure integration tests are suitable for AOT processing
1 parent 7d99790 commit 59eaed0

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

spring-test/src/test/java/org/springframework/test/context/bean/override/convention/TestBeanForByTypeLookupIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @since 6.2
3838
*/
3939
@SpringJUnitConfig
40-
class TestBeanForByTypeLookupIntegrationTests {
40+
public class TestBeanForByTypeLookupIntegrationTests {
4141

4242
@TestBean
4343
ExampleService anyNameForService;

spring-test/src/test/java/org/springframework/test/context/bean/override/convention/TestBeanForInheritanceIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
* @author Sam Brannen
4141
* @since 6.2
4242
*/
43-
class TestBeanForInheritanceIntegrationTests {
43+
public class TestBeanForInheritanceIntegrationTests {
4444

4545
static Pojo enclosingClassBeanOverride() {
4646
return new FakePojo("in enclosing test class");
4747
}
4848

4949
@SpringJUnitConfig
50-
abstract static class AbstractTestBeanIntegrationTestCase {
50+
public abstract static class AbstractTestBeanIntegrationTestCase {
5151

5252
@TestBean(name = "someBean")
5353
Pojo someBean;
@@ -70,7 +70,7 @@ static Pojo commonBeanOverride() {
7070
return new FakePojo("in superclass");
7171
}
7272

73-
interface Pojo {
73+
public interface Pojo {
7474

7575
default String getValue() {
7676
return "Prod";

spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanForBeanFactoryIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
@SpringJUnitConfig
4242
@TestMethodOrder(OrderAnnotation.class)
43-
class MockitoBeanForBeanFactoryIntegrationTests {
43+
public class MockitoBeanForBeanFactoryIntegrationTests {
4444

4545
@MockitoBean
4646
private TestBean testBean;
@@ -98,7 +98,7 @@ public boolean isSingleton() {
9898

9999
}
100100

101-
interface TestBean {
101+
public interface TestBean {
102102

103103
String hello();
104104

spring-test/src/test/java/org/springframework/test/context/bean/override/mockito/MockitoBeanForByTypeLookupIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void overrideIsFoundByTypeAndDisambiguatedByMetaQualifier(ApplicationContext ctx
123123
}
124124

125125

126-
interface AnotherService {
126+
public interface AnotherService {
127127

128128
String hello();
129129

spring-test/src/test/java/org/springframework/test/context/jdbc/PropertyPlaceholderSqlScriptsTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,23 @@
2222
import org.springframework.test.annotation.DirtiesContext;
2323
import org.springframework.test.context.ContextConfiguration;
2424
import org.springframework.test.context.TestPropertySource;
25+
import org.springframework.test.context.aot.DisabledInAotMode;
2526

2627
/**
2728
* Integration tests that verify support for property placeholders in SQL script locations.
2829
*
2930
* @author Sam Brannen
3031
* @since 6.2
3132
*/
32-
@ContextConfiguration(classes = PopulatedSchemaDatabaseConfig.class)
3333
class PropertyPlaceholderSqlScriptsTests {
3434

3535
private static final String SCRIPT_LOCATION = "classpath:org/springframework/test/context/jdbc/${vendor}/data.sql";
3636

3737
@Nested
38+
@ContextConfiguration(classes = PopulatedSchemaDatabaseConfig.class)
3839
@TestPropertySource(properties = "vendor = db1")
3940
@DirtiesContext
41+
@DisabledInAotMode // ${vendor} does not get resolved during AOT processing
4042
class DatabaseOneTests extends AbstractTransactionalTests {
4143

4244
@Test
@@ -47,8 +49,10 @@ void placeholderIsResolvedInScriptLocation() {
4749
}
4850

4951
@Nested
52+
@ContextConfiguration(classes = PopulatedSchemaDatabaseConfig.class)
5053
@TestPropertySource(properties = "vendor = db2")
5154
@DirtiesContext
55+
@DisabledInAotMode // ${vendor} does not get resolved during AOT processing
5256
class DatabaseTwoTests extends AbstractTransactionalTests {
5357

5458
@Test

0 commit comments

Comments
 (0)