Skip to content

Commit 55dc296

Browse files
committed
Rename Testcontainers bean startup property
Old name: spring.testcontainers.startup New name: spring.testcontainers.beans.startup Closes gh-37073
1 parent b8365e3 commit 55dc296

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ include::code:test/MyContainersConfiguration[]
10721072
NOTE: The lifecycle of `Container` beans is automatically managed by Spring Boot.
10731073
Containers will be started and stopped automatically.
10741074

1075-
TIP: You can use the configprop:spring.testcontainers.startup[] property to change how containers are started.
1075+
TIP: You can use the configprop:spring.testcontainers.beans.startup[] property to change how containers are started.
10761076
By default `sequential` startup is used, but you may also choose `parallel` if you wish to start multiple containers in parallel.
10771077

10781078
Once you have defined your test configuration, you can use the `with(...)` method to attach it to your test launcher:

spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersStartup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void start(Collection<? extends Startable> startables) {
6161
* The {@link Environment} property used to change the {@link TestcontainersStartup}
6262
* strategy.
6363
*/
64-
public static final String PROPERTY = "spring.testcontainers.startup";
64+
public static final String PROPERTY = "spring.testcontainers.beans.startup";
6565

6666
abstract void start(Collection<? extends Startable> startables);
6767

spring-boot-project/spring-boot-testcontainers/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"properties": [
33
{
4-
"name": "spring.testcontainers.startup",
4+
"name": "spring.testcontainers.beans.startup",
55
"type": "org.springframework.boot.testcontainers.lifecycle.TestcontainersStartup",
66
"description": "Testcontainers startup modes.",
77
"defaultValue": "sequential"

spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleApplicationContextInitializerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void setupStartupBasedOnEnvironmentProperty() {
114114
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
115115
applicationContext.getEnvironment()
116116
.getPropertySources()
117-
.addLast(new MapPropertySource("test", Map.of("spring.testcontainers.startup", "parallel")));
117+
.addLast(new MapPropertySource("test", Map.of("spring.testcontainers.beans.startup", "parallel")));
118118
new TestcontainersLifecycleApplicationContextInitializer().initialize(applicationContext);
119119
AbstractBeanFactory beanFactory = (AbstractBeanFactory) applicationContext.getBeanFactory();
120120
BeanPostProcessor beanPostProcessor = beanFactory.getBeanPostProcessors()

spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersStartupTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void getWhenUnknownPropertyThrowsException() {
8282
MockEnvironment environment = new MockEnvironment();
8383
assertThatIllegalArgumentException()
8484
.isThrownBy(() -> TestcontainersStartup.get(environment.withProperty(PROPERTY, "bad")))
85-
.withMessage("Unknown 'spring.testcontainers.startup' property value 'bad'");
85+
.withMessage("Unknown 'spring.testcontainers.beans.startup' property value 'bad'");
8686
}
8787

8888
private List<TestStartable> createTestStartables(int size) {

0 commit comments

Comments
 (0)