Previously, TestRestTemplate would only apply the UriTemplateHandler
to Strings and not to URIs. When using the auto-configured
TestRestTemplate, this prevented relative URIs from being
made absolute using LocalHostUriTemplateHandler.
The commit updates TestRestTemplate to turn URIs into Strings before
passing them to the delegate RestTemplate. Turning them into Strings
ensures that the delegate calls the UriTemplateHandler.
Closes gh-7891
Previously, when DevTools' was used it would set the application
context's ResourceLoader and overwrite any custom ResourceLoader that
had been configured. On the rare occasion when the user had customized
the ResourceLoader this meant that the customization was lost and
certain resources would become unavailable.
This commit updates DevTools' ResourceLoader to delegate a custom
ResourceLoader if one has been configured. If one has not been
configured it delegates as before, i.e. to
WebApplicationContextResourceLoader for web applications and to
DefaultResourceLoader for all others apps.
Closes gh-8010
Update `ConfigurationPropertiesBindingPostProcessor` so that
`@Validated` is expected to be used to trigger JSR-330 validation.
Any existing configuration classes that use JSR-330 annotations but
don't have `@Validated` will currently still be validated, but will
now log a warning. This should give users a chance to add the requested
annotations before the next Spring Boot release where we will use them
as the exclusive signal that validation is required.
Closes gh-7579
Replace JSR-330 validation annotations from all internal
`@ConfigurationProperties` classes with standard Asserts.
Prior to this commit validation of our own configuration properties
would only occur when the user happens to have compliant JSR-330
implementation on their classpath.
See gh-7579
The root cause of the build failure something has a null message which
means there's no information available about why the build failed.
Instead of calling fail when a BuildException occurs, this commit
wraps it in a RuntimeException and rethrows it. This should make the
entire chain of exceptions available when a failure occurs.
Previously, JarResourceManager assumed that the path would begin with
a / but this isn't always the case. For example, it may be an empty
string. This could lead to a malformed jar:file: URL that used ! as
the separator rather than the required !/.
This commit updates JarResourceManager to prepend / to any path that
does not being with one before using it to construct the URL.
Closes gh-7717
The user property is only available on Unix-like platforms (due to
the USER environment variable). This commit updates the test to
explicitly set a specific property and then check that it's accessible
via the env endpoint rather than using one that is OS-specific.
See gh-7868
See gh-7881
When the context is closed, FileWritingMessageHandler is stopped and
it closes its output files. However, it appears to do so in a manner
which means that they may be closed after the call to close the
context is completed. This causes problems on Windows as files that
are still open cannot be deleted.
This commit adds a workaround to SampleIntegrationApplicationTests
so that it makes up to 10 attempts each 0.5s apart to clean up the
input and output directories.
The intent of the test is to:
1. Make a change
2. Sleep for long enough for that change to be picked up
3. Make another change
4. Stop that watcher after 1 further scan has been performed
5. Assert that a further scan was performed by checking that two
separate sets of changes (step 1 and step 3) have been picked up
Previously, step 2 relied on simply sleeping for a period of time
longer than the polling interval. In reality, the polling interval
is only a minimum time between scans and the actual time between them
depends on thread scheduling, GC pauses, etc. This lead to the
test failing intermittently if the scan didn't happen in a timely
manner.
This commit removes the sleep and replaces it with a while loop that
waits for first change to be picked up. This ensures that the second
change will be detected separately from the first and that two
separate change sets should always be available once the watcher has
stopped.
See gh-7782