From 4c237919e3c72aa0a62a27b4587825944bc81ee9 Mon Sep 17 00:00:00 2001 From: Janos Gyerik Date: Fri, 6 Jul 2018 12:42:09 +0200 Subject: Move SANS_TOP_25_* constants to sonar-server-common --- .../src/main/java/org/sonar/server/issue/IssueQuery.java | 5 +++++ .../org/sonar/server/issue/index/IssueIteratorForSingleChunk.java | 8 ++++---- .../test/java/org/sonar/server/issue/index/IssueIndexerTest.java | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'server/sonar-server-common/src') 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 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 issueKeys; private final Collection severities; private final Collection 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 { -- cgit v1.2.3