Previously, TestRestTemplate applied the root URI to URIs by
converting them to a String and then passing the String to the
RestTemplate delegate. Being a String, meant that the URI passed
through RestTemplate's standard URI template expansion processing
using the configured UriTemplateHandler. While this caused the root
URI to be applied, it also had the unwanted side-effect of
encoding the URI for a second time.
This commit updates TestRestTemplate so that, when configured with a
RootUriTemplateHandler, it applies the root URI directly and then
passes a modified URI to the RestTemplate delegate. Being a URI means
that no template expansion is performed and the possible double
encoding is avoided.
Closes gh-8163
Update `EndpointMBeanExporter` to ensure that `JmxEndpoint` as well
as regular `Endpoint` beans are considered when searching the parent
context.
Prior to this commit if the same `JmxEndpoint` was registered in the
both the child and parent context then the `context=` element of the
name wasn't added.
Fixes gh-8152
Since SPR-15196, the behavior of `Assert` methods changed and some were
deprecated. This commit adapts to the new error mechanism implemented in
`Assert.instanceOf`.
Fixes gh-8140
SI 5 has made IntegrationComponentScanRegistrar more extensible by
offering a method for getting the back packages that can be
overridden.
This commit takes advantage of that change by removing our creation
of "fake" annotation metadata and overriding getBackPackages to return
the auto-configuration packages instead.
Closes gh-7744
The caching behaviour when using ImportAutoConfiguration is covered
by tests in spring-boot-test-auto-configuration, specifically by
ImportsContextCustomizerFactoryWithAutoConfigurationTests.
See gh-7953
Update `ImportsContextCustomizer` so that whenever possible a more
specific cache key is used.
Prior to this commit the customizer would generate a key based on *all*
annotations on the test class. This has repeatedly caused issues where
test classes that should have the same cache key did not due to
unrelated annotations.
A new `DeterminableImports` interface has been added that can be
implemented by `ImportSelector` and `ImportBeanDefinitionRegistrar`
implementations that are able to determine their imports early. The
existing `ImportAutoConfigurationImportSelector` and
`AutoConfigurationPackages` classes have been retrofitted with
this interface.
Fixes gh-7953
Update `TypeExcludeFiltersContextCustomer` to use filter instances
as part of the key, rather than class references. In order to be used
in tests, `TypeExcludeFilter` implementations must now implement valid
`hashCode` and `equals` methods.
Fixes gh-8125