Polish ClientRegistrationsTests

Simplified the assertion so that it is focused on the core
behavior being verified. This will likely also make the test
more stable when updating Spring Framework versions.

Issue gh-16860
This commit is contained in:
Josh Cummings 2025-04-29 14:02:46 -06:00
parent 0e84f31a00
commit f631a0fcd5
No known key found for this signature in database
GPG Key ID: 869B37A20E876129

View File

@ -471,15 +471,11 @@ public class ClientRegistrationsTests {
return new MockResponse().setResponseCode(responseCode);
}
});
String message = """
Unable to resolve Configuration with the provided Issuer of "%s", errors: [\
405 Client Error: [no body], \
400 Client Error: [no body], \
404 Client Error: [no body]]\
""".formatted(this.issuer);
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> ClientRegistrations.fromIssuerLocation(this.issuer).build())
.withMessage(message);
.withMessageContaining("405")
.withMessageContaining("400")
.withMessageContaining("404");
}
private ClientRegistration.Builder registration(String path) throws Exception {