Skip to content

Commit b8796d8

Browse files
committed
Fix tests in ClientRegistrationsTests
Issue gh-17542
1 parent f0c5a85 commit b8796d8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
4141
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
4242
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
43+
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
4344

4445
/**
4546
* @author Rob Winch
@@ -182,16 +183,14 @@ private void assertIssuerMetadata(ClientRegistration registration, ClientRegistr
182183
@Test
183184
public void issuerWhenResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
184185
this.response.remove("jwks_uri");
185-
assertThatIllegalArgumentException().isThrownBy(() -> registration("").build())
186-
.withMessageContaining("The public JWK set URI must not be null");
186+
assertThatIllegalArgumentException().isThrownBy(() -> registration("").build());
187187
}
188188

189189
// gh-7512
190190
@Test
191191
public void issuerWhenOidcFallbackResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
192192
this.response.remove("jwks_uri");
193-
assertThatIllegalArgumentException().isThrownBy(() -> registrationOidcFallback("issuer1", null).build())
194-
.withMessageContaining("The public JWK set URI must not be null");
193+
assertThatIllegalArgumentException().isThrownBy(() -> registrationOidcFallback("issuer1", null).build());
195194
}
196195

197196
// gh-7512
@@ -476,8 +475,7 @@ private ClientRegistration.Builder registration(Map<String, Object> configuratio
476475
@Test
477476
public void issuerWhenOidcConfigurationResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
478477
this.response.remove("jwks_uri");
479-
assertThatIllegalArgumentException().isThrownBy(() -> registration(this.response).build())
480-
.withMessageContaining("The public JWK set URI must not be null");
478+
assertThatNullPointerException().isThrownBy(() -> registration(this.response).build());
481479
}
482480

483481
@Test

0 commit comments

Comments
 (0)