From 236d058a02b709baf4cfeeab56ee226f622b9106 Mon Sep 17 00:00:00 2001 From: Zipeng WU Date: Tue, 7 Sep 2021 12:09:55 +0200 Subject: [PATCH] SONAR-15380 Remove SVN properties configuration section on Administration --- .../core/config/CorePropertyDefinitions.java | 1 - .../org/sonar/core/config/SvnProperties.java | 40 ------------------- .../config/CorePropertyDefinitionsTest.java | 2 +- .../sonar/core/config/SvnPropertiesTest.java | 31 -------------- .../sonar/scm/svn/SvnConfigurationTest.java | 2 +- 5 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 sonar-core/src/test/java/org/sonar/core/config/SvnPropertiesTest.java diff --git a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java index d3b20eab0f6..8200a483905 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java +++ b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java @@ -59,7 +59,6 @@ public class CorePropertyDefinitions { defs.addAll(PurgeProperties.all()); defs.addAll(EmailSettings.definitions()); defs.addAll(ScannerProperties.all()); - defs.addAll(SvnProperties.all()); defs.addAll(asList( PropertyDefinition.builder(CoreProperties.MODULE_LEVEL_ARCHIVED_SETTINGS) diff --git a/sonar-core/src/main/java/org/sonar/core/config/SvnProperties.java b/sonar-core/src/main/java/org/sonar/core/config/SvnProperties.java index 88dc3bc5e78..1c282cc846d 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/SvnProperties.java +++ b/sonar-core/src/main/java/org/sonar/core/config/SvnProperties.java @@ -37,44 +37,4 @@ public class SvnProperties { private SvnProperties() { //private only } - - public static List all() { - return Arrays.asList( - PropertyDefinition.builder(USER_PROP_KEY) - .name("Username") - .description("Username to be used for SVN server or SVN+SSH authentication") - .type(PropertyType.STRING) - .onQualifiers(Qualifiers.PROJECT) - .category(CoreProperties.CATEGORY_SCM) - .subCategory(CATEGORY_SVN) - .index(0) - .build(), - PropertyDefinition.builder(PASSWORD_PROP_KEY) - .name("Password") - .description("Password to be used for SVN server or SVN+SSH authentication") - .type(PropertyType.PASSWORD) - .onQualifiers(Qualifiers.PROJECT) - .category(CoreProperties.CATEGORY_SCM) - .subCategory(CATEGORY_SVN) - .index(1) - .build(), - PropertyDefinition.builder(PRIVATE_KEY_PATH_PROP_KEY) - .name("Path to private key file") - .description("Can be used instead of password for SVN+SSH authentication") - .type(PropertyType.STRING) - .onQualifiers(Qualifiers.PROJECT) - .category(CoreProperties.CATEGORY_SCM) - .subCategory(CATEGORY_SVN) - .index(2) - .build(), - PropertyDefinition.builder(PASSPHRASE_PROP_KEY) - .name("Passphrase") - .description("Optional passphrase of your private key file") - .type(PropertyType.PASSWORD) - .onQualifiers(Qualifiers.PROJECT) - .category(CoreProperties.CATEGORY_SCM) - .subCategory(CATEGORY_SVN) - .index(3) - .build()); - } } diff --git a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java index b098ef95616..b0b7cb1307e 100644 --- a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java +++ b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java @@ -30,7 +30,7 @@ public class CorePropertyDefinitionsTest { @Test public void all() { List defs = CorePropertyDefinitions.all(); - assertThat(defs).hasSize(57); + assertThat(defs).hasSize(53); } @Test diff --git a/sonar-core/src/test/java/org/sonar/core/config/SvnPropertiesTest.java b/sonar-core/src/test/java/org/sonar/core/config/SvnPropertiesTest.java deleted file mode 100644 index 183b37947ac..00000000000 --- a/sonar-core/src/test/java/org/sonar/core/config/SvnPropertiesTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2021 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.sonar.core.config; - -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class SvnPropertiesTest { - @Test - public void creates_properties() { - assertThat(SvnProperties.all()).isNotEmpty(); - } -} diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/svn/SvnConfigurationTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/svn/SvnConfigurationTest.java index c416ef39eb1..3a9fbbe90fc 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scm/svn/SvnConfigurationTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/svn/SvnConfigurationTest.java @@ -37,7 +37,7 @@ public class SvnConfigurationTest { @Test public void sanityCheck() throws Exception { - MapSettings settings = new MapSettings(new PropertyDefinitions(System2.INSTANCE, SvnProperties.all())); + MapSettings settings = new MapSettings(new PropertyDefinitions(System2.INSTANCE)); SvnConfiguration config = new SvnConfiguration(settings.asConfig()); assertThat(config.username()).isNull(); -- 2.39.5