|
16 | 16 |
|
17 | 17 | package org.springframework.security.oauth2.server.resource.web.server.authentication; |
18 | 18 |
|
19 | | -import java.util.Base64; |
20 | | - |
21 | 19 | import org.junit.jupiter.api.BeforeEach; |
22 | 20 | import org.junit.jupiter.api.Test; |
23 | | - |
24 | 21 | import org.springframework.http.HttpHeaders; |
25 | 22 | import org.springframework.http.HttpStatus; |
26 | 23 | import org.springframework.mock.http.server.reactive.MockServerHttpRequest; |
|
30 | 27 | import org.springframework.security.oauth2.server.resource.BearerTokenErrorCodes; |
31 | 28 | import org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthenticationToken; |
32 | 29 |
|
| 30 | +import java.util.Base64; |
| 31 | + |
33 | 32 | import static org.assertj.core.api.Assertions.assertThat; |
34 | 33 | import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
35 | 34 |
|
@@ -217,19 +216,6 @@ void resolveWhenQueryParameterHasMultipleAccessTokensThenOAuth2AuthenticationExc |
217 | 216 |
|
218 | 217 | } |
219 | 218 |
|
220 | | - @Test |
221 | | - public void resolveWhenQueryParameterIsPresentAndEmptyStringThenTokenIsNotResolved() { |
222 | | - this.converter.setAllowUriQueryParameter(true); |
223 | | - MockServerHttpRequest.BaseBuilder<?> request = MockServerHttpRequest.get("/").queryParam("access_token", ""); |
224 | | - assertThatExceptionOfType(OAuth2AuthenticationException.class).isThrownBy(() -> convertToToken(request)) |
225 | | - .withMessageContaining("The requested token parameter is an empty string") |
226 | | - .satisfies((e) -> { |
227 | | - BearerTokenError error = (BearerTokenError) e.getError(); |
228 | | - assertThat(error.getErrorCode()).isEqualTo(BearerTokenErrorCodes.INVALID_REQUEST); |
229 | | - assertThat(error.getHttpStatus()).isEqualTo(HttpStatus.BAD_REQUEST); |
230 | | - }); |
231 | | - } |
232 | | - |
233 | 219 | private BearerTokenAuthenticationToken convertToToken(MockServerHttpRequest.BaseBuilder<?> request) { |
234 | 220 | return convertToToken(request.build()); |
235 | 221 | } |
|
0 commit comments