From the Open ID Discovery Spec:
If the Issuer value contains a path component, any terminating / MUST be removed before appending /.well-known/openid-configuration.
Coincidentally, this is taken care of by virtue of using UriComponentsBuilder, which both JwtDecoders and ClientRegistrations (via RestTemplate) use.
And, MockWebServer automatically adds a trailing slash to its base path, which means that JwtDecodersTests and ClientRegistrationsTest have been testing this scenario implicitly all along.
We should add at least one explicit test to each of these that confirms that when the issuer contains a slash at the end, then these classes still work correctly. This way, if these classes stop using MockWebServer then that specific behavior will continue to be tested.
Related to spring-projects/spring-boot#15324