aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-auth-gitlab/src/test/java
diff options
context:
space:
mode:
authorAntoine Vinot <antoine.vinot@sonarsource.com>2023-04-13 16:57:56 +0200
committersonartech <sonartech@sonarsource.com>2023-04-24 20:04:23 +0000
commit68977b2bedc95c738b58bc8be83a00d21e13c32e (patch)
tree3c77243a1b04651f6cb7031e825901e40a37df79 /server/sonar-auth-gitlab/src/test/java
parentf6aef43f6848a27861171cc8e757085326a334f2 (diff)
downloadsonarqube-68977b2bedc95c738b58bc8be83a00d21e13c32e.tar.gz
sonarqube-68977b2bedc95c738b58bc8be83a00d21e13c32e.zip
SONAR-19045 Migrate from javaxi.servlet to framework agnostic plugin api classes
Co-authored-by: Eric Giffon <eric.giffon@sonarsource.com> Co-authored-by: Alain Kermis <alain.kermis@sonarsource.com> Co-authored-by: Antoine Vinot <antoine.vinot@sonarsource.com> Co-authored-by: Jacek Poreda <jacek.poreda@sonarsource.com>
Diffstat (limited to 'server/sonar-auth-gitlab/src/test/java')
-rw-r--r--server/sonar-auth-gitlab/src/test/java/org/sonar/auth/gitlab/IntegrationTest.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/server/sonar-auth-gitlab/src/test/java/org/sonar/auth/gitlab/IntegrationTest.java b/server/sonar-auth-gitlab/src/test/java/org/sonar/auth/gitlab/IntegrationTest.java
index 3f8d35e3f6f..dfeabc36e14 100644
--- a/server/sonar-auth-gitlab/src/test/java/org/sonar/auth/gitlab/IntegrationTest.java
+++ b/server/sonar-auth-gitlab/src/test/java/org/sonar/auth/gitlab/IntegrationTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.auth.gitlab;
-import javax.servlet.http.HttpServletRequest;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import org.assertj.core.api.Assertions;
@@ -31,6 +30,7 @@ import org.mockito.Mockito;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.server.authentication.OAuth2IdentityProvider;
import org.sonar.api.server.authentication.UserIdentity;
+import org.sonar.api.server.http.HttpRequest;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
@@ -76,9 +76,9 @@ public class IntegrationTest {
OAuth2IdentityProvider.CallbackContext callbackContext = Mockito.mock(OAuth2IdentityProvider.CallbackContext.class);
when(callbackContext.getCallbackUrl()).thenReturn("http://server/callback");
- HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
- when(httpServletRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
- when(callbackContext.getRequest()).thenReturn(httpServletRequest);
+ HttpRequest httpRequest = Mockito.mock(HttpRequest.class);
+ when(httpRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
+ when(callbackContext.getHttpRequest()).thenReturn(httpRequest);
gitlab.enqueue(new MockResponse().setBody(
"{\n" + " \"access_token\": \"de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54\",\n" + " \"token_type\": \"bearer\",\n" + " \"expires_in\": 7200,\n"
@@ -104,9 +104,9 @@ public class IntegrationTest {
OAuth2IdentityProvider.CallbackContext callbackContext = Mockito.mock(OAuth2IdentityProvider.CallbackContext.class);
when(callbackContext.getCallbackUrl()).thenReturn("http://server/callback");
- HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
- when(httpServletRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
- when(callbackContext.getRequest()).thenReturn(httpServletRequest);
+ HttpRequest httpRequest = Mockito.mock(HttpRequest.class);
+ when(httpRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
+ when(callbackContext.getHttpRequest()).thenReturn(httpRequest);
gitlab.enqueue(new MockResponse().setBody(
"{\n" + " \"access_token\": \"de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54\",\n" + " \"token_type\": \"bearer\",\n" + " \"expires_in\": 7200,\n"
@@ -133,9 +133,9 @@ public class IntegrationTest {
OAuth2IdentityProvider.CallbackContext callbackContext = Mockito.mock(OAuth2IdentityProvider.CallbackContext.class);
when(callbackContext.getCallbackUrl()).thenReturn("http://server/callback");
- HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
- when(httpServletRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
- when(callbackContext.getRequest()).thenReturn(httpServletRequest);
+ HttpRequest httpRequest = Mockito.mock(HttpRequest.class);
+ when(httpRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
+ when(callbackContext.getHttpRequest()).thenReturn(httpRequest);
gitlab.enqueue(new MockResponse().setBody(
"{\n" + " \"access_token\": \"de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54\",\n" + " \"token_type\": \"bearer\",\n" + " \"expires_in\": 7200,\n"
@@ -173,9 +173,9 @@ public class IntegrationTest {
OAuth2IdentityProvider.CallbackContext callbackContext = Mockito.mock(OAuth2IdentityProvider.CallbackContext.class);
when(callbackContext.getCallbackUrl()).thenReturn("http://server/callback");
- HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class);
- when(httpServletRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
- when(callbackContext.getRequest()).thenReturn(httpServletRequest);
+ HttpRequest httpRequest = Mockito.mock(HttpRequest.class);
+ when(httpRequest.getParameter("code")).thenReturn(ANY_CODE_VALUE);
+ when(callbackContext.getHttpRequest()).thenReturn(httpRequest);
gitlab.enqueue(new MockResponse().setBody(
"{\n" + " \"access_token\": \"de6780bc506a0446309bd9362820ba8aed28aa506c71eedbe1c5c4f9dd350e54\",\n" + " \"token_type\": \"bearer\",\n" + " \"expires_in\": 7200,\n"