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