Previously, if spring.main.web-application-type was configured in
application.properties to servlet or reactive, setting
webEnvironment=NONE on @SpringBootTest would not work correctly and
a servlet or reactive web application context would be created
based on the value of spring.main.web-application-type.
This commit updates the test context bootstapper to set
spring.main.web-application-type to none when webEnvironment has been
set to none. This is done in the merged context configuration's
property source properties which are applied to the environment in a
high-precedence test property source that will override configuration
in application.properties.
Closes gh-29695
Previously, SpringBootContextLoader would configure its
SpringApplication with an ApplicationContextFactory that ignores
the WebApplicationType with which its called and instead returns a
hard-coded type of context based on the type of the
MergedContextConfiguration. This hard-coding would result in the
wrong type of context being used if a subsequent change was made to
the application's WebApplicationType, for example due to binding of
the spring.main.web-application-type configuration property.
This commit updates SpringBootContextLoader to configure
SpringApplication with an ApplicationContextFactory that takes the
WebApplicationType with which it is called into consideration.
Fixes gh-29170
This commit adds the ability to configure SSL in embedded web containers
using PEM-encoded certificate and private key files, as an alternative
to configuring SSL with Java KeyStore files.
Closes gh-29273
Prior to this commit, Spring Boot would only auto-configure the
`RestHighLevelClient` and `RestClientBuilder` if the
`RestHighLevelClient` was present. This was done in 1d73d4ed.
This commit brings back the exposing of the `RestClient` bean in when
exposing the `RestHighLevelClient` or when the `RestHighLevelClient`
is not present. It allows for using the auto-configuration and its
customizers of the `RestClientBuilder` in a similar way as it is done
for the `RestTemplateBuilder` and the `WebClient.Builder`.
The presence of the `elasticsearch-rest-high-level-client` module is
now optional. This opens the door for potentially adding support for
the new Elasticsearch Java Client[1] that is based on the same
`RestClient`.
The health contributor and its configuration has also been updated to
only depend on the low-level RestClient.
See gh-28496
[1] https://github.com/elastic/elasticsearch-java
Prior to this commit, the auto-configured
`ExecutionGraphQlServiceTester` would use a default Jackson
`ObjectMapper` provided by the builder for its JSON
serialization/deserialization needs. Other testers, like the
`HttpGraphQlTester` are based on auto-configured components which
already use the auto-configured `ObjectMapper`.
This commit uses the newly introduced `encoder(Encoder<?>)` and
`decoder(Decoder<?>)` builder methods to configure custom JSON codecs
honoring the application configuration.
Closes gh-30646
As a result of changes for
https://github.com/spring-projects/spring-graphql/issues/342,
GraphQlWebSocketHandler now exposes a method to create the
WebSocketHttpRequestHandler, pre-configured with a context propagating
HandshakeInterceptor. This commit updates the autoconfig to use it.
Closes gh-30641