aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/test/java/org/sonarqube/ws/client
diff options
context:
space:
mode:
authorAurelien Poscia <aurelien.poscia@sonarsource.com>2023-02-10 10:47:32 +0100
committersonartech <sonartech@sonarsource.com>2023-02-10 20:02:45 +0000
commitd8f977b4a4d2b3e3e6ab2316b8c6dec02c1c55dc (patch)
tree70ed4c6f6d092afebded9fe7ed2d1660e095475c /sonar-ws/src/test/java/org/sonarqube/ws/client
parent0def12a0a76202cf026a4c33f8c2b5c82986bb7c (diff)
downloadsonarqube-d8f977b4a4d2b3e3e6ab2316b8c6dec02c1c55dc.tar.gz
sonarqube-d8f977b4a4d2b3e3e6ab2316b8c6dec02c1c55dc.zip
SONAR-18397 add ITs for permanent users de-provisioning triggered by Azure (SCIM)
Diffstat (limited to 'sonar-ws/src/test/java/org/sonarqube/ws/client')
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/DeleteRequestTest.java40
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/GetRequestTest.java40
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java6
3 files changed, 83 insertions, 3 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/DeleteRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/DeleteRequestTest.java
new file mode 100644
index 00000000000..24b3986bd65
--- /dev/null
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/DeleteRequestTest.java
@@ -0,0 +1,40 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client;
+
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DeleteRequestTest {
+
+ private DeleteRequest deleteRequest = new DeleteRequest("path");
+
+ @Test
+ public void getMethod_shouldReturnDelete() {
+ assertThat(deleteRequest.getMethod()).isEqualTo(WsRequest.Method.DELETE);
+ }
+
+
+ @Test
+ public void addVerbToBuilder_shouldReturnNonNullResult() {
+ assertThat(deleteRequest.addVerbToBuilder()).isNotNull();
+ }
+}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/GetRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/GetRequestTest.java
new file mode 100644
index 00000000000..2f5c66059ce
--- /dev/null
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/GetRequestTest.java
@@ -0,0 +1,40 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client;
+
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class GetRequestTest {
+
+ private GetRequest getRequest = new GetRequest("path");
+
+ @Test
+ public void getMethod_shouldReturnGet() {
+ assertThat(getRequest.getMethod()).isEqualTo(WsRequest.Method.GET);
+ }
+
+ @Test
+ public void addVerbToBuilder_shouldReturnNonNullResult() {
+ assertThat(getRequest.addVerbToBuilder()).isNotNull();
+ }
+
+}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
index 6898c537894..bb6d9040f26 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
@@ -140,10 +140,10 @@ public class ServiceTester<T extends BaseService> extends ExternalResource {
@CheckForNull
public GetRequest getGetRequest() {
assertSingleGetCall();
- return getCalls.iterator().next().getRequest();
+ return (GetRequest) getCalls.iterator().next().getRequest();
}
- public RequestAssert<GetRequest> assertThat(GetRequest getRequest) {
+ public RequestAssert<?> assertThat(GetRequest getRequest) {
return new RequestAssert<>(getRequest);
}
@@ -189,7 +189,7 @@ public class ServiceTester<T extends BaseService> extends ExternalResource {
}
@Immutable
- public static final class GetCall extends CallWithParser<GetRequest> {
+ public static final class GetCall extends CallWithParser<RequestWithoutPayload<GetRequest>> {
public GetCall(GetRequest getRequest, @Nullable Parser<?> parser) {
super(getRequest, parser);