We should add the same test support that Spring Boot has to help us modify the classpath to make it easier to create tests.

One place that this is needed is in #11347 which checks if Spring MVC is present in the classpath to decide which RequestMatcher implementation to use.

More places will require this feature since we should use the Spring Framework feature that initialize constants at build-time.

See: - #11347 - #11437