Browse Source

Fix tests in ClientRegistrationsTests

Issue gh-17542
pull/17538/head
Joe Grandja 5 months ago
parent
commit
b8796d84b7
  1. 10
      oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/registration/ClientRegistrationsTests.java

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

@ -40,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -40,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
/**
* @author Rob Winch
@ -182,16 +183,14 @@ public class ClientRegistrationsTests { @@ -182,16 +183,14 @@ public class ClientRegistrationsTests {
@Test
public void issuerWhenResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
this.response.remove("jwks_uri");
assertThatIllegalArgumentException().isThrownBy(() -> registration("").build())
.withMessageContaining("The public JWK set URI must not be null");
assertThatIllegalArgumentException().isThrownBy(() -> registration("").build());
}
// gh-7512
@Test
public void issuerWhenOidcFallbackResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
this.response.remove("jwks_uri");
assertThatIllegalArgumentException().isThrownBy(() -> registrationOidcFallback("issuer1", null).build())
.withMessageContaining("The public JWK set URI must not be null");
assertThatIllegalArgumentException().isThrownBy(() -> registrationOidcFallback("issuer1", null).build());
}
// gh-7512
@ -476,8 +475,7 @@ public class ClientRegistrationsTests { @@ -476,8 +475,7 @@ public class ClientRegistrationsTests {
@Test
public void issuerWhenOidcConfigurationResponseMissingJwksUriThenThrowsIllegalArgumentException() throws Exception {
this.response.remove("jwks_uri");
assertThatIllegalArgumentException().isThrownBy(() -> registration(this.response).build())
.withMessageContaining("The public JWK set URI must not be null");
assertThatNullPointerException().isThrownBy(() -> registration(this.response).build());
}
@Test

Loading…
Cancel
Save