Update `SpringApplicationShutdownHook` so the underlying set of
`Runnable` instances are stored in a `LinkedHashSet` rather than
a `Collections.newSetFromMap(new IdentityHashMap<>())`. This insures
that shutdown hooks are run in the order that they are added.
Fixes gh-43430
Before this commit, only a single ResourceHandlerRegistrationCustomizer
was invoked. This commit adds functionality to have more
than one ResourceHandlerRegistrationCustomizers
See gh-43494
Add a new `TestcontainersStartup.start` static method and update the
existing start methods so that `Startable.start()` is only called when
the container is not already running.
Prior to this commit, we assumed that `Startable.start()` calls were
idempotent and could be safely made multiple times. Whilst this appears
to be true for stock `GenericContainer` based startables, users may have
their own `start()` method that does not expect to be called multiple
times.
The implemented detection logic will not be applied if a `Startable`
is not also a `Container`. In these cases, the implementation will need
to deal directly with multiple `start()` calls.
Fixed gh-43253
Prior to this change, the failure analysis for an invalid
configuration property value filtered out the configuration property
sources property source. This property source contains a "duplicate"
of all of the environment's other property sources but with
configuration property support (such as relaxed/fuzzy matching of
environment variables). This was done to prevent the reporting of
duplicates when a property was found in both the configuration
property sources property source and the "normal" property sources.
An unwanted side-effect of this was that fuzzy matching of
environment variables was lost so the origin of
com.example.some-property would be found in the environment variable
was COM_EXAMPLE_SOME_PROPERTY but would not be found if it was
COM_EXAMPLE_SOMEPROPERTY.
This commit addresses this side-effect by no longer filtering out
the configuration property sources property source. To then
prevent duplicates from being reported in the analysis, it instead
deduplicates things based on the origin of each property that's
found in the environment's property sources.
Fixes gh-43380
Add `requestFactorySettings` that accepts a `UnaryOperator` so that
the existing `requestFactorySettings` can be customized rather than
replaced.
Closes gh-43258
Update `DockerApi` so that calls are made using a fixed version. For
most calls this will be `v1.24`, however, for calls with a platform
we must use the `v1.41`.
When possible, we check that the Docker version in use meets the
required minimum, however, if we can't detect the running version
we now proceed and let the actual API call fail. This is due to the
fact that the `/_ping` endpoint may not always be available. For
example, it is restricted when building from a BitBucket CI pipeline.
Fixes gh-43452
Apache Kafka now ships a new module, kafka-server, since the 3.7.0
release. The `3.9.0` kafka-client introduced some breaking changes that
require this dependecy for the `EmbeddedKafka` support in Spring for
Apache Kafka.
This commit adds this dependecny for Spring Boot based Spring Kafka
projects.
See gh-43450
Restore `buildConsumerProperties()` and `buildProducerProperties()`
methods in `KafkaProperties` to make it more convenient to use them
without an SSL bundle.
Fixes gh-43300
Update jar mode launchers to catch all exceptions and return a non-zero
exit code. This refinement also allows us to consolidate the existing
error reporting logic to a central locations. Modes that wish to report
a simple error rather than a full stacktrace can throw the newly
introduced `JarModeErrorException`.
Fixes gh-43435
Update `TestRestTemplate` with a `withRequestFactorySettings` method
that can be used to change defaults such as `Redirects`.
This commit also restores the previous redirect defaults for HTTP
components where redirects would only be followed when the
`HttpClientOption.ENABLE_REDIRECTS` was specified.
Closes gh-43258
Add `redirects(...)` method to `RestTemplateBuilder` to allow redirect
customization. This new method is required in 3.4 since the default
redirect strategy for some clients has changed and users need a way
to restore the old behavior.
See gh-43258
Prior to this change, the failure analysis for an invalid
configuration property value filtered out the configuration property
sources property source. This property source contains a "duplicate"
of all of the environment's other property sources but with
configuration property support (such as relaxed/fuzzy matching of
environment variables). This was done to prevent the reporting of
duplicates when a property was found in both the configuration
property sources property source and the "normal" property sources.
An unwanted side-effect of this was that fuzzy matching of
environment variables was lost so the origin of
com.example.some-property would be found in the environment variable
was COM_EXAMPLE_SOME_PROPERTY but would not be found if it was
COM_EXAMPLE_SOMEPROPERTY.
This commit addresses this side-effect by no longer filtering out
the configuration property sources property source. To then
prevent duplicates from being reported in the analysis, it instead
deduplicates things based on the origin of each property that's
found in the environment's property sources.
Fixes gh-43380
Update `SslAutoConfiguration` so that the used resource loader prefers
file based resolution when paths are specified without a prefix. This
restores the behavior found in Spring Boot 3.3.
The `ApplicationResourceLoader` has been updated with a new `get` method
that accepts a `preferFileResolution` parameter. Unfortunately, we can't
directly influence the resource returned by the delegate
`ResourceLoader` since we can't override `getResourceByPath(...)`.
Instead we check if the returned type was likely to have been created
by a call to that method. If so, we change it to a `FileSystemResource`.
This approach should hopefully work with `DefaultResourceLoader` and
subclasses.
Fixes gh-43274