aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-webapi
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2022-09-23 15:53:13 +0200
committersonartech <sonartech@sonarsource.com>2022-09-26 20:03:17 +0000
commitbb479f8716776ab8a68a9fd24ddabc578f889dc9 (patch)
tree9d7cba2ab17295daca347e39600ac0576ba17bf3 /server/sonar-webserver-webapi
parentba965061cb213d8897a8575c95d2ad944671d2eb (diff)
downloadsonarqube-bb479f8716776ab8a68a9fd24ddabc578f889dc9.tar.gz
sonarqube-bb479f8716776ab8a68a9fd24ddabc578f889dc9.zip
SONAR-17117 migrate project import feature trigger to /api/features/list endpoint
Diffstat (limited to 'server/sonar-webserver-webapi')
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java7
-rw-r--r--server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/global-example.json1
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java25
3 files changed, 0 insertions, 33 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java
index e08588d7149..0eaf0ec4ac5 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java
@@ -140,7 +140,6 @@ public class GlobalAction implements NavigationWsAction, Startable {
writeBranchSupport(json);
writeInstanceUsesDefaultAdminCredentials(json);
writeMultipleAlmEnabled(json);
- writeProjectImportFeature(json);
editionProvider.get().ifPresent(e -> json.prop("edition", e.name().toLowerCase(Locale.ENGLISH)));
writeNeedIssueSync(json);
json.prop("standalone", webServer.isStandalone());
@@ -207,12 +206,6 @@ public class GlobalAction implements NavigationWsAction, Startable {
json.prop("multipleAlmEnabled", multipleAlmFeatureProvider.enabled());
}
- private void writeProjectImportFeature(JsonWriter json) {
- Edition edition = editionProvider.get().orElse(null);
- boolean isEnabled = isEditionEEorDCE(edition);
- json.prop("projectImportFeatureEnabled", isEnabled);
- }
-
private void writeNeedIssueSync(JsonWriter json) {
try (DbSession dbSession = dbClient.openSession(false)) {
json.prop("needIssueSync", issueIndexSyncChecker.isIssueSyncInProgress(dbSession));
diff --git a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/global-example.json b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/global-example.json
index 7a110f13d78..700eee264bc 100644
--- a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/global-example.json
+++ b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/global-example.json
@@ -26,7 +26,6 @@
"version": "6.2",
"productionDatabase": true,
"branchesEnabled": false,
- "projectImportFeatureEnabled": false,
"canAdmin": false,
"standalone": true,
"edition": "community"
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java
index b37184ad49b..efa3d9568ec 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java
@@ -52,7 +52,6 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import static org.sonar.core.platform.EditionProvider.Edition.*;
import static org.sonar.test.JsonAssert.assertJson;
public class GlobalActionTest {
@@ -239,30 +238,6 @@ public class GlobalActionTest {
}
@Test
- public void project_import_feature_enabled_ee_dce() {
- init();
- when(editionProvider.get()).thenReturn(Optional.of(ENTERPRISE));
- assertJson(call()).isSimilarTo("{\"projectImportFeatureEnabled\":true}");
-
- when(editionProvider.get()).thenReturn(Optional.of(DATACENTER));
- assertJson(call()).isSimilarTo("{\"projectImportFeatureEnabled\":true}");
- }
-
- @Test
- public void project_import_feature_disabled_ce_de() {
- init();
- when(editionProvider.get()).thenReturn(Optional.of(COMMUNITY));
- assertJson(call()).isSimilarTo("{\"projectImportFeatureEnabled\":false}");
-
- when(editionProvider.get()).thenReturn(Optional.of(DEVELOPER));
- assertJson(call()).isSimilarTo("{\"projectImportFeatureEnabled\":false}");
-
- when(editionProvider.get()).thenReturn(Optional.empty());
- assertJson(call()).isSimilarTo("{\"projectImportFeatureEnabled\":false}");
- }
-
-
- @Test
public void return_need_issue_sync() {
init();
when(indexSyncProgressChecker.isIssueSyncInProgress(any())).thenReturn(true);