Browse Source

Add gh-10130 to tests

pull/10041/head
Steve Riesenberg 5 years ago
parent
commit
fc553bf19a
  1. 4
      oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveAuthorizationCodeTokenResponseClientTests.java
  2. 4
      oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveClientCredentialsTokenResponseClientTests.java
  3. 4
      oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactivePasswordTokenResponseClientTests.java
  4. 4
      oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveRefreshTokenTokenResponseClientTests.java

4
oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveAuthorizationCodeTokenResponseClientTests.java

@ -343,18 +343,21 @@ public class WebClientReactiveAuthorizationCodeTokenResponseClientTests { @@ -343,18 +343,21 @@ public class WebClientReactiveAuthorizationCodeTokenResponseClientTests {
return new OAuth2AuthorizationCodeGrantRequest(registration, authorizationExchange);
}
// gh-10130
@Test
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
OAuth2AuthorizationCodeGrantRequest request = authorizationCodeGrantRequest();
@ -380,6 +383,7 @@ public class WebClientReactiveAuthorizationCodeTokenResponseClientTests { @@ -380,6 +383,7 @@ public class WebClientReactiveAuthorizationCodeTokenResponseClientTests {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2AuthorizationCodeGrantRequest request = authorizationCodeGrantRequest();

4
oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveClientCredentialsTokenResponseClientTests.java

@ -214,18 +214,21 @@ public class WebClientReactiveClientCredentialsTokenResponseClientTests { @@ -214,18 +214,21 @@ public class WebClientReactiveClientCredentialsTokenResponseClientTests {
this.server.enqueue(response);
}
// gh-10130
@Test
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.client.setHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.client.addHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
OAuth2ClientCredentialsGrantRequest request = new OAuth2ClientCredentialsGrantRequest(
@ -251,6 +254,7 @@ public class WebClientReactiveClientCredentialsTokenResponseClientTests { @@ -251,6 +254,7 @@ public class WebClientReactiveClientCredentialsTokenResponseClientTests {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2ClientCredentialsGrantRequest request = new OAuth2ClientCredentialsGrantRequest(

4
oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactivePasswordTokenResponseClientTests.java

@ -218,18 +218,21 @@ public class WebClientReactivePasswordTokenResponseClientTests { @@ -218,18 +218,21 @@ public class WebClientReactivePasswordTokenResponseClientTests {
// @formatter:on
}
// gh-10130
@Test
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
OAuth2PasswordGrantRequest request = new OAuth2PasswordGrantRequest(this.clientRegistrationBuilder.build(),
@ -256,6 +259,7 @@ public class WebClientReactivePasswordTokenResponseClientTests { @@ -256,6 +259,7 @@ public class WebClientReactivePasswordTokenResponseClientTests {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2PasswordGrantRequest request = new OAuth2PasswordGrantRequest(this.clientRegistrationBuilder.build(),

4
oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveRefreshTokenTokenResponseClientTests.java

@ -221,18 +221,21 @@ public class WebClientReactiveRefreshTokenTokenResponseClientTests { @@ -221,18 +221,21 @@ public class WebClientReactiveRefreshTokenTokenResponseClientTests {
// @formatter:on
}
// gh-10130
@Test
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
.withMessage("headersConverter cannot be null");
}
// gh-10130
@Test
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
OAuth2RefreshTokenGrantRequest request = new OAuth2RefreshTokenGrantRequest(
@ -259,6 +262,7 @@ public class WebClientReactiveRefreshTokenTokenResponseClientTests { @@ -259,6 +262,7 @@ public class WebClientReactiveRefreshTokenTokenResponseClientTests {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2RefreshTokenGrantRequest request = new OAuth2RefreshTokenGrantRequest(

Loading…
Cancel
Save