Update `TestcontainersLifecycleBeanPostProcessor` to restore early
container initialization logic and refine startup logic. Initial bean
access now again triggers the creation all container beans. In addition
the first access of a `Startable` bean now attempts to find and start
all other `Startable` beans.
Fixes gh-37989
Add support for a `spring.testcontainers.startup` property that can
be set to "sequential" or "parallel" to change how containers are
started.
Closes gh-37073
Using `@ServiceConnection` results in the definition of one or more
connection details beans. These bean definitions use an instance
supplier which is not supported by AOT. This results in a failure during
AOT processing.
This commit introduces a BeanRegistrationExcludeFilter to exclude from
AOT processing the beans created from a `@ServiceConnection`. They are
not needed as the registrar will run again in the native image and
define the beans at which point the use of an instance supplier is
supported again.
Fixes gh-35663
Update `TestcontainersLifecycleBeanPostProcessor` to that initialization
doesn't fail if a `BeanCurrentlyInCreationException` is thrown.
Prior to this commit, if the first bean being post-processed was a
configuration class declaring a bean that the `Container` depended on
all initialization would fail.
See gh-35223
Update `TestcontainersLifecycleBeanPostProcessor` so that on
initialization of the first bean all `Container` instances are started.
With this update all `Container` beans will be started first in the
`preInstantiateSingletons` phase and destroyed last.
Closes gh-35223
Update `ServiceConnectionContextCustomizer` so that is applies the
`TestcontainersLifecycleApplicationContextInitializer` to all
application contexts.
Closes gh-35222
Update `ServiceConnectionContextCustomizer` with `equals` and `hashcode`
methods so that it works correctly when part of a context cache key.
Closes gh-35216
Update testcontainers auto-configuration so that `Container` bean
instances are no longer needed when registering `ConnectionDetails`
beans. Registration now occurs based on the bean type and the `name`
attribute of `@ServiceConnection`.
Fixes gh-35168
Update `ContainerConnectionDetailsFactory` so that they consistently
extend `ContainerConnectionDetails`. The container is also no longer
accessible from the `ContainerConnectionSource` and is never used
during the construction of `ConnectionDetails` instances.
See gh-35168
This commit adds org.testcontainers:testcontainers as an api dependency
of spring-boot-testcontainers so that GenericContainer can be used
without an additional dependency
See gh-35119
Redpanda (https://redpanda.com/) is Kafka-compatible and
Testcontainers provides a module. This commit adds support for
creating KafkaConnectionDetails from a
@ServiceConnection-annotated RedpandaContainer.
See gh-34780
Add auto-configuration for `Container` beans that are also
annotated with `@ServiceConnection`. This commit allow
testcontainers to be used at development time and a new section
has been added to the documentation to describe the feature.
Closes gh-35022
Add `TestcontainersLifecycleApplicationContextInitializer` and
`TestcontainersLifecycleBeanPostProcessor` to take care of starting and
stopping `Container` beans.
Closes gh-35021
Update restcontainers service connections support so that
technology specific `@ServiceConnector` annotations are not longer
required.
A single `@ServiceConnector` annotation can now be used to create
all `ConnectionDetail` beans.
Closes gh-35017