Skip to content

Commit fc553bf

Browse files
author
Steve Riesenberg
committed
Add gh-10130 to tests
1 parent acca3db commit fc553bf

4 files changed

+16
-0
lines changed

Diff for: oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveAuthorizationCodeTokenResponseClientTests.java

+4
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,21 @@ private OAuth2AuthorizationCodeGrantRequest pkceAuthorizationCodeGrantRequest()
343343
return new OAuth2AuthorizationCodeGrantRequest(registration, authorizationExchange);
344344
}
345345

346+
// gh-10130
346347
@Test
347348
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
348349
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
349350
.withMessage("headersConverter cannot be null");
350351
}
351352

353+
// gh-10130
352354
@Test
353355
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
354356
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
355357
.withMessage("headersConverter cannot be null");
356358
}
357359

360+
// gh-10130
358361
@Test
359362
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
360363
OAuth2AuthorizationCodeGrantRequest request = authorizationCodeGrantRequest();
@@ -380,6 +383,7 @@ public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
380383
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
381384
}
382385

386+
// gh-10130
383387
@Test
384388
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
385389
OAuth2AuthorizationCodeGrantRequest request = authorizationCodeGrantRequest();

Diff for: oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveClientCredentialsTokenResponseClientTests.java

+4
Original file line numberDiff line numberDiff line change
@@ -214,18 +214,21 @@ private void enqueueJson(String body) {
214214
this.server.enqueue(response);
215215
}
216216

217+
// gh-10130
217218
@Test
218219
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
219220
assertThatIllegalArgumentException().isThrownBy(() -> this.client.setHeadersConverter(null))
220221
.withMessage("headersConverter cannot be null");
221222
}
222223

224+
// gh-10130
223225
@Test
224226
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
225227
assertThatIllegalArgumentException().isThrownBy(() -> this.client.addHeadersConverter(null))
226228
.withMessage("headersConverter cannot be null");
227229
}
228230

231+
// gh-10130
229232
@Test
230233
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
231234
OAuth2ClientCredentialsGrantRequest request = new OAuth2ClientCredentialsGrantRequest(
@@ -251,6 +254,7 @@ public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
251254
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
252255
}
253256

257+
// gh-10130
254258
@Test
255259
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
256260
OAuth2ClientCredentialsGrantRequest request = new OAuth2ClientCredentialsGrantRequest(

Diff for: oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactivePasswordTokenResponseClientTests.java

+4
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,21 @@ private MockResponse jsonResponse(String json) {
218218
// @formatter:on
219219
}
220220

221+
// gh-10130
221222
@Test
222223
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
223224
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
224225
.withMessage("headersConverter cannot be null");
225226
}
226227

228+
// gh-10130
227229
@Test
228230
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
229231
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
230232
.withMessage("headersConverter cannot be null");
231233
}
232234

235+
// gh-10130
233236
@Test
234237
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
235238
OAuth2PasswordGrantRequest request = new OAuth2PasswordGrantRequest(this.clientRegistrationBuilder.build(),
@@ -256,6 +259,7 @@ public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
256259
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
257260
}
258261

262+
// gh-10130
259263
@Test
260264
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
261265
OAuth2PasswordGrantRequest request = new OAuth2PasswordGrantRequest(this.clientRegistrationBuilder.build(),

Diff for: oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/endpoint/WebClientReactiveRefreshTokenTokenResponseClientTests.java

+4
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,21 @@ private MockResponse jsonResponse(String json) {
221221
// @formatter:on
222222
}
223223

224+
// gh-10130
224225
@Test
225226
public void setHeadersConverterWhenNullThenThrowIllegalArgumentException() {
226227
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.setHeadersConverter(null))
227228
.withMessage("headersConverter cannot be null");
228229
}
229230

231+
// gh-10130
230232
@Test
231233
public void addHeadersConverterWhenNullThenThrowIllegalArgumentException() {
232234
assertThatIllegalArgumentException().isThrownBy(() -> this.tokenResponseClient.addHeadersConverter(null))
233235
.withMessage("headersConverter cannot be null");
234236
}
235237

238+
// gh-10130
236239
@Test
237240
public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
238241
OAuth2RefreshTokenGrantRequest request = new OAuth2RefreshTokenGrantRequest(
@@ -259,6 +262,7 @@ public void convertWhenHeadersConverterAddedThenCalled() throws Exception {
259262
assertThat(actualRequest.getHeader("custom-header-name")).isEqualTo("custom-header-value");
260263
}
261264

265+
// gh-10130
262266
@Test
263267
public void convertWhenHeadersConverterSetThenCalled() throws Exception {
264268
OAuth2RefreshTokenGrantRequest request = new OAuth2RefreshTokenGrantRequest(

0 commit comments

Comments
 (0)