Previously, MockRestServiceServerAutoConfiguration unconditionally
defined its beans, preventing the user from providing an alternative.
This commit adds @ConditionalOnMissingBean to ensure the auto-configuration
backs off when a user-provided alternatives are present.
See gh-48825
Signed-off-by: HuitaePark <qkrgmlxo3174@gmail.com>
Remove the `always()` call from the same site mapping and replace `as`
with a direct call. This update means that mapping only occurs when
`getSameSite` is not `null`, but mapping can still be applied if
`sameSite.getAttributeValue()` returns `null`.
Closes gh-48830
Following modularization, a presence check for ValidatorAdapter was
needed in the MVC and WebFlux auto-configuratiomn when creating
their Validators. Runtime hints to allow this check to work in a
native image were not added at the same time, resulting in the
class appearing to be absent. This caused message interpolation
for constraint violations to fail as newly created Validator was
being used which lacked the necessary MessageInterpolator
configuration.
This commit adds reflection hints for ValidatorAdapter, allowing
re-use of the context's main validator as the MVC and WebFlux
validators.
Fixes gh-48828
Spring Projects that have the `spring.graphql.schema.locations` property
set to `"classpath*:graphql/**/"` as suggested in the documentation have
failing GraphQL tests after upgrading to Spring Boot 4.
The `Query` type definition in the books-domain schema clashes with the
schema of the application. Presumably the books-domain schema was never
meant to exist in the exported JAR file. This commit moves it into the
test module to stop it from being exported and causing problems.
Signed-off-by: mspiess <30656914+mspiess@users.noreply.github.com>
See gh-48829
Previously, CloudFoundryActuatorAutoConfiguration required
RestTemplateBuilder, using it to create the RestTemplate that's used
the security interceptor. Following the modularization,
RestTemplateBuilder is only present when spring-boot-restclient is on
the classpath. In its absence, CloudFoundryActuatorAutoConfiguration
would fail.
This commit address this problem by using RestClient.Builder (and
RestClient) instead of RestTemplateBuilder (and RestTemplate). This
allows CloudFoundryActuatorAutoConfiguration to work without
spring-boot-restclient as RestClient.Builder and RestClient are
provided by spring-web that will always be there in an MVC webapp.
Fixes gh-48826
The built-in decompression support in HttpClient 5.6 breaks
Elasticsearch's Rest5Client as it results in double decompression.
The first decompression is performed by the Apache HTTP client. It
succeeds. The Elasticsearch Rest5Client then sees the
Content-Encoding: gzip header and makes a second attempt to inflate
the data. This fails as it has already been inflated.
Closes gh-48743
Update `HttpServiceClientProperties` to use direct binding rather than
using `@ConfigurationProperties`. The prevents metadata and IDE issues
and also allows the class API to be simplified.
Closes gh-48616
This commit fixes a regression where RANDOM_PORT was no longer honored
if a defined management port is set. Due to the modularization efforts,
the code has moved from an EnvironmentPostProcessor to an
ApplicationListener. Unfortunately, the listener is registered too
late to handle the event it is listening to. While the event type could
have been changed, the listener was added on the ApplicationContext
which are not honored before the ApplicationContext is in a state to be
used.
The contract of ContextCustomizerFactory is already giving us everything
we need. While the environment is post-processed later than we would
like, it is still post-processed before the refresh state so that the
additional property is honored.
This commit also adds an integration test to cover this scenario.
Closes gh-48653
Prior to this commit, gh-48310 separated client and server message
converter configurations by switching from message converter instances
as beans in the application context, to server/client customizers that
are applied to the `HttpMessageConverters` instances while being built.
This change did not order the new ClientHttpMessageConvertersCustomizer
or ServerHttpMessageConvertersCustomizer, letting those being at the
"lowest precedence" default. As customizers, this means they are applied
last and custom instances cannot take over.
This commit ensures that such customizers provided by Spring Boot are
now ordered at "0" to let applications ones take over.
Fixes gh-48635
Prior to this commit, gh-48310 separated client and server message
converter configurations by switching from message converter instances
as beans in the application context, to server/client customizers that
are applied to the `HttpMessageConverters` instances while being built.
This change did not order the new ClientHttpMessageConvertersCustomizer
or ServerHttpMessageConvertersCustomizer, letting those being at the
"lowest precedence" default. As customizers, this means they are applied
last and custom instances cannot take over.
This commit ensures that such customizers provided by Spring Boot are
now ordered at "0" to let applications ones take over.
Fixes gh-48609
This commit improves the auto-configuration of the JSonMapper.Builder
to accept a custom JsonFactory if a bean of this type is present.
Closes gh-48594
This commit improves the builder to provide the message factory upfront
rather than setting it after the WebServiceTemplate has been
instantiated.
By providing the factory upfront (if it is set), it prevents the
default strategy to be created first to be then erased by the custom
factory.
Closes gh-48615
The MustacheResourceTemplateLoader previously defined the template
encoding as a String, defaulting to "UTF-8". This change replaces the
field with a Charset and initializes it with StandardCharsets.UTF_8.
Using Charset improves type safety and aligns with modern Spring Boot
standards, while avoiding implicit charset lookup issues.
See gh-48347
Signed-off-by: djlee <ddongjunn@gmail.com>
This commit auto-configures the following beans with their corresponding
conventions, when available:
- ProcessorMetrics with JvmCpuMeterConventions
- JvmMemoryMetrics with JvmMemoryMeterConventions
- JvmThreadMetrics with JvmThreadMeterConventions
- ClassLoaderMetrics with JvmClassLoadingMeterConventions
See gh-47935
Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
This commit introduces a `SimpleJmsListenerContainerFactoryConfigurer`
that can be used to conveniently apply settings provided
by JMS auto-configuration to `SimpleJmsListenerContainerFactory`
instances.
See gh-47716
Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
JdbcSessionAutoConfiguration is conditional on the DataSource bean
which won't exist until after DataSourceAutoConfiguration; therefore,
JdbcSessionAutoConfiguration must auto-configure after
DataSourceAutoConfiguration.
Signed-off-by: Craig Andrews <candrews@integralblue.com>
See gh-48552
Previously, the connection details would only back off if another
PropertiesOtlpLoggingConnectionDetails was defined. This commit
corrects this so that they will back of if any
OtlpLoggingConnectionDetails implementation is defined as a bean.
Closes gh-48536