Add gh-10130 to tests

This commit is contained in:
Steve Riesenberg 2021-08-09 15:30:41 -05:00
parent acca3dba69
commit fc553bf19a
4 changed files with 16 additions and 0 deletions

View File

@ -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 {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2AuthorizationCodeGrantRequest request = authorizationCodeGrantRequest();

View File

@ -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 {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2ClientCredentialsGrantRequest request = new OAuth2ClientCredentialsGrantRequest(

View File

@ -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 {
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(),

View File

@ -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 {
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
}
// gh-10130
@Test
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
OAuth2RefreshTokenGrantRequest request = new OAuth2RefreshTokenGrantRequest(