Reduce the number of times capacity growth is needed inside the StringWriter.
A typical default SpringBoot Prometheus page has more than 11k characters.
Best performance results when no capacity growth is needed at all, so base
it on previous metrics page size plus some room for possible extra metric info.
See gh-30085
- Adds a new @DisableOnOs annotation, which is inspired from JUnit5s
@DisableOnOs annotation. This new annotation supports the architecture
and is repeatable
Closes gh-30082
TunnelClientTests stopTriggersTunnelClose expects that stopping the
client will cause an attempt to read from a connected channel to
return -1. With Java 17 on Windows the connection has been reset and
a SocketException is thrown instead. This seems reasonable as
stopping the client closes the ServerSocketChannel to which the test
was connected.
This commit updates test to expect a SocketException or a return
value of -1.
Closes gh-30042
The changes for gh-28562 attempted to align the Gradle plugin's
handling of META-INF with the Maven plugin's behavior. Unfortunately,
they want too far, applying the handling to both jar and war files
when the Maven plugin only applies it to jar files.
This commit reworks the changes so that they only apply to jar files.
Closes gh-30026
Previously, all integral numbers were parsed as integers. This
caused two problems:
1. Compilation would fail if the default value for a long wasn't a
valid integer.
2. The default value for a byte or short could be out of range,
resulting in the generation of invalid metadata and an error
that could have been caught at compile time not being caught
until runtime.
This commit updates the parsing of all numeric values to use the
parse method of the target primitive type. For example,
Short.parseShort(String) is now used to parse a short.
Fixes gh-30020
This commit clarifies the build as a test needs inject-api and it works
only by side effect as another library has repackaged this API.
Closes gh-29990
Prior to this change, SpringApplication would register contexts to
SpringApplicationShutdownHook and only deregister them when they're
properly closed. A failed refresh attempt does not deregister the
context from the shutdown hook.
When a test suite runs lots of tests failing because of failed contexts,
this can build up and consume lots of resources.
This commit fixes this leak and deregisters failed contexts.
Fixes gh-29874
The regular expression in the new test is intended to match the
documented [1] ABNF for a media type:
type-name = reg-name
subtype-name = reg-name
reg-name = 1*127reg-name-chars
reg-name-chars = ALPHA / DIGIT / "!" /
"#" / "$" / "&" / "." /
"+" / "-" / "^" / "_"
Closes gh-29746
[1] https://datatracker.ietf.org/doc/html/rfc4288#section-4.2
Previously, when Tomcat was configured to use relative redirects
and the ForwardedHeaderFilter is in use, the filter would ignore
the use of the relative redirects.
This commit corrects this misalignment by applying Tomcat's use
relative redirects setting to the filter, but only when Tomcat is
being used as the servlet container.
See gh-29333
This involved a small code change to the generated configuration
properties snippets. The section id has to start with
'appendix.', otherwise the section-id asciidoctor extension
complains. To ensure that the anchors that are derived from the
section IDs remain backwards compatible, the anchor-rewrite
properties have been updated.
See gh-29667
Previously, the classpath of bootJar, bootWar, and bootRun was
configured directly as a FileCollection derived from the main source
set's runtime classpath. This direct configuration meant that
subsequent changes to the main source set's runtime classpath may not
have been picked up.
This commit changes the configuration of the classpath to use a
Callable. This indirection allows subsequent changes to the main
source set's runtime classpath to be picked up as long as they
occur before Gradle calls the callable.
Closes gh-29672
This commit updates DatabaseInitializationDependencyConfigurer so that
it does not inject the Environment anymore. Doing so in such a low-level
callback can lead to early resolution of factory beans. Rather, this
commit uses the EnvironmentAware callback that short-circuit dependency
resolution.
Closes gh-29475
Update `ConfigDataEnvironmentContributor.isActive` so that unbound
imports are no longer considered active. Prior to this commit, any
`ConfigDataEnvironmentContributor` that had `null` properties was
considered active. This is incorrect for `Kind.UNBOUND_IMPORT`
contributors since we haven't yet bound the `spring.config.*`
properties.
The `ConfigDataEnvironmentContributorPlaceholdersResolver` has been
updated to handle the refined logic. A placeholder can now be resolved
from the current contributor, or from an unbound contributor by binding
it on the fly.
Fixes gh-29386
Update `SpringBootContextLoader` so that when possible the
`SpringApplication` remains in control of creating the `Environment`
instance.
Prior to this commit, we would always create the `Environment` in the
`SpringBootContextLoader` and then call `setEnvironment` on the
`SpringApplication`. This meant that the `ApplicationEnvironment`
classes were not used and that `isCustomEnvironment` was set to `true`
so no conversion was applied.
With the updated code, an `ApplicationListener` is used to mutate the
`Environment` instance and add the required test property sources.
Fixes gh-29169
We've seen some problems, particularly on CI, where Embedded Mongo
hangs while trying to start the Mongo process. To limit the problem,
this commit replaces the use of Embedded Mongo with Testcontainers
where we can, leaving Embedded Mongo in use only where we're
specifically testing our Embedded Mongo support.
Closes gh-28843