Skip to content

Commit b2b111f

Browse files
committed
Remove duplicate test case
Issue gh-15885
1 parent 5c531e0 commit b2b111f

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

oauth2/oauth2-resource-server/src/test/java/org/springframework/security/oauth2/server/resource/web/server/authentication/ServerBearerTokenAuthenticationConverterTests.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616

1717
package org.springframework.security.oauth2.server.resource.web.server.authentication;
1818

19-
import java.util.Base64;
20-
2119
import org.junit.jupiter.api.BeforeEach;
2220
import org.junit.jupiter.api.Test;
23-
2421
import org.springframework.http.HttpHeaders;
2522
import org.springframework.http.HttpStatus;
2623
import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
@@ -30,6 +27,8 @@
3027
import org.springframework.security.oauth2.server.resource.BearerTokenErrorCodes;
3128
import org.springframework.security.oauth2.server.resource.authentication.BearerTokenAuthenticationToken;
3229

30+
import java.util.Base64;
31+
3332
import static org.assertj.core.api.Assertions.assertThat;
3433
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
3534

@@ -217,19 +216,6 @@ void resolveWhenQueryParameterHasMultipleAccessTokensThenOAuth2AuthenticationExc
217216

218217
}
219218

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-
233219
private BearerTokenAuthenticationToken convertToToken(MockServerHttpRequest.BaseBuilder<?> request) {
234220
return convertToToken(request.build());
235221
}

0 commit comments

Comments
 (0)