Skip to content

Commit 50a3bcf

Browse files
committed
Remove unused code
1 parent a88b8bf commit 50a3bcf

File tree

1 file changed

+1
-78
lines changed

1 file changed

+1
-78
lines changed

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

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -191,83 +191,6 @@ private void configureJwtClientAuthenticationConverter(Function<ClientRegistrati
191191
this.tokenResponseClient.addParametersConverter(jwtClientAuthenticationConverter);
192192
}
193193

194-
// @Test
195-
// public void
196-
// getTokenResponseWhenRedirectUriMalformedThenThrowIllegalArgumentException() throws
197-
// Exception {
198-
// this.exception.expect(IllegalArgumentException.class);
199-
//
200-
// String redirectUri = "http:\\example.com";
201-
// when(this.clientRegistration.getRedirectUri()).thenReturn(redirectUri);
202-
//
203-
// this.tokenResponseClient.getTokenResponse(
204-
// new OAuth2AuthorizationCodeGrantRequest(this.clientRegistration,
205-
// this.authorizationExchange));
206-
// }
207-
//
208-
// @Test
209-
// public void
210-
// getTokenResponseWhenTokenUriMalformedThenThrowIllegalArgumentException() throws
211-
// Exception {
212-
// this.exception.expect(IllegalArgumentException.class);
213-
//
214-
// String tokenUri = "http:\\provider.com\\oauth2\\token";
215-
// when(this.providerDetails.getTokenUri()).thenReturn(tokenUri);
216-
//
217-
// this.tokenResponseClient.getTokenResponse(
218-
// new OAuth2AuthorizationCodeGrantRequest(this.clientRegistration,
219-
// this.authorizationExchange));
220-
// }
221-
//
222-
// @Test
223-
// public void
224-
// getTokenResponseWhenSuccessResponseInvalidThenThrowOAuth2AuthorizationException()
225-
// throws Exception {
226-
// this.exception.expect(OAuth2AuthorizationException.class);
227-
// this.exception.expectMessage(containsString("invalid_token_response"));
228-
//
229-
// MockWebServer server = new MockWebServer();
230-
//
231-
// String accessTokenSuccessResponse = "{\n" +
232-
// " \"access_token\": \"access-token-1234\",\n" +
233-
// " \"token_type\": \"bearer\",\n" +
234-
// " \"expires_in\": \"3600\",\n" +
235-
// " \"scope\": \"openid profile\",\n" +
236-
// " \"custom_parameter_1\": \"custom-value-1\",\n" +
237-
// " \"custom_parameter_2\": \"custom-value-2\"\n";
238-
// // "}\n"; // Make the JSON invalid/malformed
239-
//
240-
// server.enqueue(new MockResponse()
241-
// .setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
242-
// .setBody(accessTokenSuccessResponse));
243-
// server.start();
244-
//
245-
// String tokenUri = server.url("/oauth2/token").toString();
246-
// when(this.providerDetails.getTokenUri()).thenReturn(tokenUri);
247-
//
248-
// try {
249-
// this.tokenResponseClient.getTokenResponse(
250-
// new OAuth2AuthorizationCodeGrantRequest(this.clientRegistration,
251-
// this.authorizationExchange));
252-
// } finally {
253-
// server.shutdown();
254-
// }
255-
// }
256-
//
257-
// @Test
258-
// public void
259-
// getTokenResponseWhenTokenUriInvalidThenThrowAuthenticationServiceException() throws
260-
// Exception {
261-
// this.exception.expect(AuthenticationServiceException.class);
262-
//
263-
// String tokenUri = "https://invalid-provider.com/oauth2/token";
264-
// when(this.providerDetails.getTokenUri()).thenReturn(tokenUri);
265-
//
266-
// this.tokenResponseClient.getTokenResponse(
267-
// new OAuth2AuthorizationCodeGrantRequest(this.clientRegistration,
268-
// this.authorizationExchange));
269-
// }
270-
//
271194
@Test
272195
public void getTokenResponseWhenErrorResponseThenThrowOAuth2AuthorizationException() {
273196
String accessTokenErrorResponse = "{\n" + " \"error\": \"unauthorized_client\"\n" + "}\n";

0 commit comments

Comments
 (0)