Skip to content

Commit f631a0f

Browse files
committed
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
1 parent 0e84f31 commit f631a0f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/registration/ClientRegistrationsTests.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -471,15 +471,11 @@ public MockResponse dispatch(RecordedRequest request) {
471471
return new MockResponse().setResponseCode(responseCode);
472472
}
473473
});
474-
String message = """
475-
Unable to resolve Configuration with the provided Issuer of "%s", errors: [\
476-
405 Client Error: [no body], \
477-
400 Client Error: [no body], \
478-
404 Client Error: [no body]]\
479-
""".formatted(this.issuer);
480474
assertThatExceptionOfType(IllegalArgumentException.class)
481475
.isThrownBy(() -> ClientRegistrations.fromIssuerLocation(this.issuer).build())
482-
.withMessage(message);
476+
.withMessageContaining("405")
477+
.withMessageContaining("400")
478+
.withMessageContaining("404");
483479
}
484480

485481
private ClientRegistration.Builder registration(String path) throws Exception {

0 commit comments

Comments
 (0)