Rename Testcontainers bean startup property
Old name: spring.testcontainers.startup New name: spring.testcontainers.beans.startup Closes gh-37073
This commit is contained in:
@@ -1072,7 +1072,7 @@ include::code:test/MyContainersConfiguration[]
|
||||
NOTE: The lifecycle of `Container` beans is automatically managed by Spring Boot.
|
||||
Containers will be started and stopped automatically.
|
||||
|
||||
TIP: You can use the configprop:spring.testcontainers.startup[] property to change how containers are started.
|
||||
TIP: You can use the configprop:spring.testcontainers.beans.startup[] property to change how containers are started.
|
||||
By default `sequential` startup is used, but you may also choose `parallel` if you wish to start multiple containers in parallel.
|
||||
|
||||
Once you have defined your test configuration, you can use the `with(...)` method to attach it to your test launcher:
|
||||
|
||||
@@ -61,7 +61,7 @@ public enum TestcontainersStartup {
|
||||
* The {@link Environment} property used to change the {@link TestcontainersStartup}
|
||||
* strategy.
|
||||
*/
|
||||
public static final String PROPERTY = "spring.testcontainers.startup";
|
||||
public static final String PROPERTY = "spring.testcontainers.beans.startup";
|
||||
|
||||
abstract void start(Collection<? extends Startable> startables);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "spring.testcontainers.startup",
|
||||
"name": "spring.testcontainers.beans.startup",
|
||||
"type": "org.springframework.boot.testcontainers.lifecycle.TestcontainersStartup",
|
||||
"description": "Testcontainers startup modes.",
|
||||
"defaultValue": "sequential"
|
||||
|
||||
@@ -114,7 +114,7 @@ class TestcontainersLifecycleApplicationContextInitializerTests {
|
||||
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
|
||||
applicationContext.getEnvironment()
|
||||
.getPropertySources()
|
||||
.addLast(new MapPropertySource("test", Map.of("spring.testcontainers.startup", "parallel")));
|
||||
.addLast(new MapPropertySource("test", Map.of("spring.testcontainers.beans.startup", "parallel")));
|
||||
new TestcontainersLifecycleApplicationContextInitializer().initialize(applicationContext);
|
||||
AbstractBeanFactory beanFactory = (AbstractBeanFactory) applicationContext.getBeanFactory();
|
||||
BeanPostProcessor beanPostProcessor = beanFactory.getBeanPostProcessors()
|
||||
|
||||
@@ -82,7 +82,7 @@ class TestcontainersStartupTests {
|
||||
MockEnvironment environment = new MockEnvironment();
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> TestcontainersStartup.get(environment.withProperty(PROPERTY, "bad")))
|
||||
.withMessage("Unknown 'spring.testcontainers.startup' property value 'bad'");
|
||||
.withMessage("Unknown 'spring.testcontainers.beans.startup' property value 'bad'");
|
||||
}
|
||||
|
||||
private List<TestStartable> createTestStartables(int size) {
|
||||
|
||||
Reference in New Issue
Block a user