diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-07-06 12:42:09 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-07-17 20:21:24 +0200 |
commit | 4c237919e3c72aa0a62a27b4587825944bc81ee9 (patch) | |
tree | ab2d6c2da20b7df67e53a4d916645d3a68126dca | |
parent | e5d4ef578a9cab0d6ee6049e8207ab2e988f8eda (diff) | |
download | sonarqube-4c237919e3c72aa0a62a27b4587825944bc81ee9.tar.gz sonarqube-4c237919e3c72aa0a62a27b4587825944bc81ee9.zip |
Move SANS_TOP_25_* constants to sonar-server-common
4 files changed, 15 insertions, 10 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQuery.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQuery.java index 86b3400e411..23e28bfd249 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQuery.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/IssueQuery.java @@ -57,6 +57,11 @@ public class IssueQuery { public static final Set<String> SORTS = ImmutableSet.of(SORT_BY_CREATION_DATE, SORT_BY_UPDATE_DATE, SORT_BY_CLOSE_DATE, SORT_BY_ASSIGNEE, SORT_BY_SEVERITY, SORT_BY_STATUS, SORT_BY_FILE_LINE); + public static final String UNKNOWN_STANDARD = "unknown"; + public static final String SANS_TOP_25_INSECURE_INTERACTION = "insecure-interaction"; + public static final String SANS_TOP_25_RISKY_RESOURCE = "risky-resource"; + public static final String SANS_TOP_25_POROUS_DEFENSES = "porous-defenses"; + private final Collection<String> issueKeys; private final Collection<String> severities; private final Collection<String> statuses; diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java index e2fd803ba2c..549974561f8 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/index/IssueIteratorForSingleChunk.java @@ -50,10 +50,10 @@ import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.sonar.api.utils.DateUtils.longToDate; import static org.sonar.db.DatabaseUtils.getLong; -import static org.sonar.server.issue.ws.SearchAction.SANS_TOP_25_INSECURE_INTERACTION; -import static org.sonar.server.issue.ws.SearchAction.SANS_TOP_25_POROUS_DEFENSES; -import static org.sonar.server.issue.ws.SearchAction.SANS_TOP_25_RISKY_RESOURCE; -import static org.sonar.server.issue.ws.SearchAction.UNKNOWN_STANDARD; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_INSECURE_INTERACTION; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_POROUS_DEFENSES; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_RISKY_RESOURCE; +import static org.sonar.server.issue.IssueQuery.UNKNOWN_STANDARD; /** * Scrolls over table ISSUES and reads documents to populate diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java index 1b5310ca460..0d9fc391d8b 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java @@ -56,9 +56,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.rules.ExpectedException.none; import static org.sonar.db.component.ComponentTesting.newFileDto; import static org.sonar.server.issue.IssueDocTesting.newDoc; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_POROUS_DEFENSES; +import static org.sonar.server.issue.IssueQuery.UNKNOWN_STANDARD; import static org.sonar.server.issue.index.IssueIndexDefinition.INDEX_TYPE_ISSUE; -import static org.sonar.server.issue.ws.SearchAction.SANS_TOP_25_POROUS_DEFENSES; -import static org.sonar.server.issue.ws.SearchAction.UNKNOWN_STANDARD; import static org.sonar.server.permission.index.AuthorizationTypeSupport.TYPE_AUTHORIZATION; public class IssueIndexerTest { diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java index 2b792c9e7f9..400424b7c39 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchAction.java @@ -75,7 +75,11 @@ import static java.util.stream.Collectors.toList; import static org.sonar.api.utils.Paging.forPageIndex; import static org.sonar.core.util.stream.MoreCollectors.toSet; import static org.sonar.server.es.SearchOptions.MAX_LIMIT; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_INSECURE_INTERACTION; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_POROUS_DEFENSES; +import static org.sonar.server.issue.IssueQuery.SANS_TOP_25_RISKY_RESOURCE; import static org.sonar.server.issue.IssueQuery.SORT_BY_ASSIGNEE; +import static org.sonar.server.issue.IssueQuery.UNKNOWN_STANDARD; import static org.sonar.server.issue.IssueQueryFactory.UNKNOWN; import static org.sonar.server.ws.KeyExamples.KEY_BRANCH_EXAMPLE_001; import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001; @@ -131,10 +135,6 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_TYPES; public class SearchAction implements IssuesWsAction { public static final String LOGIN_MYSELF = "__me__"; - public static final String UNKNOWN_STANDARD = "unknown"; - public static final String SANS_TOP_25_INSECURE_INTERACTION = "insecure-interaction"; - public static final String SANS_TOP_25_RISKY_RESOURCE = "risky-resource"; - public static final String SANS_TOP_25_POROUS_DEFENSES = "porous-defenses"; private static final String INTERNAL_PARAMETER_DISCLAIMER = "This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. "; private static final Set<String> IGNORED_FACETS = newHashSet(PARAM_PLANNED, DEPRECATED_PARAM_ACTION_PLANS, PARAM_REPORTERS); |