diff options
author | Pierre Guillot <pierre.guillot@sonarsource.com> | 2019-05-10 09:40:58 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-05-22 20:21:15 +0200 |
commit | cb3d8324f859cf5733646616e1e20efbd07ffebb (patch) | |
tree | e75afe2d8b3190c25c9596f26bc96e232904f315 /server | |
parent | ea8bc156195d95eef947ff49dd4d2535a3c56d26 (diff) | |
download | sonarqube-cb3d8324f859cf5733646616e1e20efbd07ffebb.tar.gz sonarqube-cb3d8324f859cf5733646616e1e20efbd07ffebb.zip |
SONAR-12026 add transition reset as to review
Diffstat (limited to 'server')
10 files changed, 209 insertions, 173 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java index 4304fb721c8..eca4e74b473 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java @@ -179,8 +179,7 @@ public class IssueWorkflow implements Startable { .transition(Transition.builder(DefaultTransitions.OPEN_AS_VULNERABILITY) .from(STATUS_REVIEWED).to(STATUS_OPEN) .conditions(new HasType(RuleType.SECURITY_HOTSPOT)) - .functions(new SetResolution(null)) - .functions(new SetType(RuleType.VULNERABILITY)) + .functions(new SetResolution(null), new SetType(RuleType.VULNERABILITY)) .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) .build()) .transition(Transition.builder(DefaultTransitions.OPEN_AS_VULNERABILITY) @@ -196,49 +195,25 @@ public class IssueWorkflow implements Startable { .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) .build()) - // all transitions below have to be removed by the end of the MMF-1635 - .transition(Transition.builder(DefaultTransitions.DETECT) - .from(STATUS_TO_REVIEW).to(STATUS_OPEN) + .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW) + .from(STATUS_IN_REVIEW).to(STATUS_TO_REVIEW) .conditions(new HasType(RuleType.SECURITY_HOTSPOT)) - .functions(new SetType(RuleType.VULNERABILITY)) + .functions(new SetResolution(null)) .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) .build()) - .transition(Transition.builder(DefaultTransitions.DETECT) - .from(STATUS_RESOLVED).to(STATUS_OPEN) - .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_WONT_FIX)) - .functions(new SetType(RuleType.VULNERABILITY), new SetResolution(null)) + .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW) + .from(STATUS_REVIEWED).to(STATUS_TO_REVIEW) + .conditions(new HasType(RuleType.SECURITY_HOTSPOT)) + .functions(new SetResolution(null)) .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) .build()) - .transition(Transition.builder(DefaultTransitions.DISMISS) + .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW) .from(STATUS_OPEN).to(STATUS_TO_REVIEW) - .conditions(IsManualVulnerability.INSTANCE) - .functions(new SetType(RuleType.SECURITY_HOTSPOT)) - .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) - .build()) - .transition(Transition.builder(DefaultTransitions.REJECT) - .from(STATUS_RESOLVED).to(STATUS_REOPENED) - .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_FIXED)) - .functions(new SetType(RuleType.VULNERABILITY), new SetResolution(null)) - .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) - .build()) - .transition(Transition.builder(DefaultTransitions.ACCEPT) - .from(STATUS_RESOLVED).to(STATUS_RESOLVED) - .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_FIXED)) - .functions(new SetResolution(RESOLUTION_WONT_FIX)) - .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) - .build()) - .transition(Transition.builder(DefaultTransitions.CLEAR) - .from(STATUS_TO_REVIEW).to(STATUS_RESOLVED) - .conditions(new HasType(RuleType.SECURITY_HOTSPOT)) - .functions(new SetResolution(RESOLUTION_WONT_FIX)) + .conditions(new HasType(RuleType.VULNERABILITY), IsManualVulnerability.INSTANCE) + .functions(new SetType(RuleType.SECURITY_HOTSPOT), new SetResolution(null)) .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) .build()) - .transition(Transition.builder(DefaultTransitions.REOPEN_HOTSPOT) - .from(STATUS_RESOLVED).to(STATUS_TO_REVIEW) - .conditions(new HasType(RuleType.SECURITY_HOTSPOT)) - .functions(new SetResolution(null)) - .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN) - .build()); + ; } private static void buildAutomaticTransitions(StateMachine.Builder builder) { diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowForSecurityHotspotsTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowForSecurityHotspotsTest.java index 6e37f7bca71..7a5cff3c3ed 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowForSecurityHotspotsTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowForSecurityHotspotsTest.java @@ -19,8 +19,6 @@ */ package org.sonar.server.issue.workflow; -import com.google.common.base.Function; -import com.google.common.collect.Collections2; import com.tngtech.java.junit.dataprovider.DataProvider; import com.tngtech.java.junit.dataprovider.DataProviderRunner; import com.tngtech.java.junit.dataprovider.UseDataProvider; @@ -29,7 +27,6 @@ import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.List; -import javax.annotation.Nullable; import org.apache.commons.lang.time.DateUtils; import org.junit.Test; import org.junit.runner.RunWith; @@ -40,12 +37,12 @@ import org.sonar.api.rules.RuleType; import org.sonar.core.issue.DefaultIssue; import org.sonar.core.issue.FieldDiffs; import org.sonar.core.issue.IssueChangeContext; +import org.sonar.core.util.stream.MoreCollectors; import org.sonar.server.issue.IssueFieldsSetter; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.issue.Issue.RESOLUTION_FIXED; import static org.sonar.api.issue.Issue.RESOLUTION_REMOVED; -import static org.sonar.api.issue.Issue.RESOLUTION_WONT_FIX; import static org.sonar.api.issue.Issue.STATUS_CLOSED; import static org.sonar.api.issue.Issue.STATUS_IN_REVIEW; import static org.sonar.api.issue.Issue.STATUS_OPEN; @@ -65,6 +62,31 @@ public class IssueWorkflowForSecurityHotspotsTest { private IssueWorkflow underTest = new IssueWorkflow(new FunctionExecutor(updater), updater); + @DataProvider + public static Object[][] allStatusesLeadingToClosed() { + return Arrays.stream(ALL_STATUSES_LEADING_TO_CLOSED) + .map(t -> new Object[] {t}) + .toArray(Object[][]::new); + } + + private static DefaultIssue newClosedIssue(String resolution) { + return new DefaultIssue() + .setKey("ABCDE") + .setRuleKey(RuleKey.of("js", "S001")) + .setResolution(resolution) + .setStatus(STATUS_CLOSED) + .setNew(false) + .setCloseDate(new Date(5_999_999L)); + } + + private static void setStatusPreviousToClosed(DefaultIssue issue, String previousStatus) { + addStatusChange(issue, new Date(), previousStatus, STATUS_CLOSED); + } + + private static void addStatusChange(DefaultIssue issue, Date date, String previousStatus, String newStatus) { + issue.addChange(new FieldDiffs().setCreationDate(date).setDiff("status", previousStatus, newStatus)); + } + @Test public void list_out_transitions_in_status_to_review() { underTest.start(); @@ -72,7 +94,7 @@ public class IssueWorkflowForSecurityHotspotsTest { List<Transition> transitions = underTest.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("setinreview", "detect", "clear", "resolveasreviewed", "openasvulnerability"); + assertThat(keys(transitions)).containsExactlyInAnyOrder("setinreview", "resolveasreviewed", "openasvulnerability"); } @Test @@ -82,27 +104,27 @@ public class IssueWorkflowForSecurityHotspotsTest { List<Transition> transitions = underTest.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("resolveasreviewed", "openasvulnerability"); + assertThat(keys(transitions)).containsExactlyInAnyOrder("resolveasreviewed", "openasvulnerability", "resetastoreview"); } @Test - public void list_out_transitions_in_status_reviwed() { + public void list_out_transitions_in_status_reviewed() { underTest.start(); DefaultIssue issue = new DefaultIssue().setType(RuleType.SECURITY_HOTSPOT).setStatus(STATUS_REVIEWED); List<Transition> transitions = underTest.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("openasvulnerability"); + assertThat(keys(transitions)).containsExactlyInAnyOrder("openasvulnerability", "resetastoreview"); } @Test - public void list_out_transitions_in_status_open() { + public void list_out_vulnerability_transitions_in_status_open() { underTest.start(); - DefaultIssue issue = new DefaultIssue().setType(RuleType.VULNERABILITY).setStatus(STATUS_OPEN).setResolution(RESOLUTION_FIXED).setIsFromHotspot(true); + DefaultIssue issue = new DefaultIssue().setType(RuleType.VULNERABILITY).setResolution(RESOLUTION_FIXED).setStatus(STATUS_OPEN).setIsFromHotspot(true); List<Transition> transitions = underTest.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("resolveasreviewed", "dismiss"); // dismiss to be remove by the end of the MMF-1635 + assertThat(keys(transitions)).containsExactlyInAnyOrder("resolveasreviewed", "resetastoreview"); } @Test @@ -203,6 +225,54 @@ public class IssueWorkflowForSecurityHotspotsTest { } @Test + public void reset_as_to_review_from_reviewed() { + underTest.start(); + DefaultIssue issue = new DefaultIssue() + .setType(RuleType.SECURITY_HOTSPOT) + .setIsFromHotspot(true) + .setStatus(STATUS_REVIEWED) + .setResolution(RESOLUTION_FIXED); + + boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1")); + assertThat(result).isTrue(); + assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT); + assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW); + assertThat(issue.resolution()).isNull(); + } + + @Test + public void reset_as_to_review_from_in_review() { + underTest.start(); + DefaultIssue issue = new DefaultIssue() + .setType(RuleType.SECURITY_HOTSPOT) + .setIsFromHotspot(true) + .setStatus(STATUS_IN_REVIEW) + .setResolution(null); + + boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1")); + assertThat(result).isTrue(); + assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT); + assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW); + assertThat(issue.resolution()).isNull(); + } + + @Test + public void reset_as_to_review_from_opened_as_vulnerability() { + underTest.start(); + DefaultIssue issue = new DefaultIssue() + .setType(RuleType.VULNERABILITY) + .setIsFromHotspot(true) + .setStatus(STATUS_OPEN) + .setResolution(null); + + boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1")); + assertThat(result).isTrue(); + assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT); + assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW); + assertThat(issue.resolution()).isNull(); + } + + @Test public void automatically_close_resolved_security_hotspots_in_status_to_review() { underTest.start(); DefaultIssue issue = new DefaultIssue() @@ -260,6 +330,26 @@ public class IssueWorkflowForSecurityHotspotsTest { } @Test + public void automatically_close_hotspots_opened_as_vulnerability() { + underTest.start(); + DefaultIssue issue = new DefaultIssue() + .setType(RuleType.VULNERABILITY) + .setResolution(null) + .setStatus(STATUS_OPEN) + .setIsFromHotspot(true) + .setNew(false) + .setBeingClosed(true); + Date now = new Date(); + + underTest.doAutomaticTransition(issue, IssueChangeContext.createScan(now)); + + assertThat(issue.resolution()).isEqualTo(RESOLUTION_FIXED); + assertThat(issue.status()).isEqualTo(STATUS_CLOSED); + assertThat(issue.closeDate()).isNotNull(); + assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(now, Calendar.SECOND)); + } + + @Test @UseDataProvider("allStatusesLeadingToClosed") public void do_not_automatically_reopen_closed_issues_of_security_hotspots(String previousStatus) { DefaultIssue[] issues = Arrays.stream(SUPPORTED_RESOLUTIONS_FOR_UNCLOSING) @@ -318,13 +408,6 @@ public class IssueWorkflowForSecurityHotspotsTest { }); } - @DataProvider - public static Object[][] allStatusesLeadingToClosed() { - return Arrays.stream(ALL_STATUSES_LEADING_TO_CLOSED) - .map(t -> new Object[] {t}) - .toArray(Object[][]::new); - } - @Test public void do_not_allow_to_doManualTransition_when_condition_fails() { underTest.start(); @@ -332,38 +415,15 @@ public class IssueWorkflowForSecurityHotspotsTest { .setKey("ABCDE") // Detect is only available on hotspot .setType(RuleType.VULNERABILITY) - .setIsFromHotspot(true) - .setStatus(STATUS_RESOLVED) - .setResolution(RESOLUTION_WONT_FIX) + .setIsFromHotspot(false) + .setStatus(STATUS_OPEN) + .setResolution(null) .setRuleKey(XOO_X1); - assertThat(underTest.doManualTransition(issue, DefaultTransitions.DETECT, IssueChangeContext.createScan(new Date()))).isFalse(); - } - - private static DefaultIssue newClosedIssue(String resolution) { - return new DefaultIssue() - .setKey("ABCDE") - .setRuleKey(RuleKey.of("js", "S001")) - .setResolution(resolution) - .setStatus(STATUS_CLOSED) - .setNew(false) - .setCloseDate(new Date(5_999_999L)); - } - - private static void setStatusPreviousToClosed(DefaultIssue issue, String previousStatus) { - addStatusChange(issue, new Date(), previousStatus, STATUS_CLOSED); - } - - private static void addStatusChange(DefaultIssue issue, Date date, String previousStatus, String newStatus) { - issue.addChange(new FieldDiffs().setCreationDate(date).setDiff("status", previousStatus, newStatus)); + assertThat(underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createScan(new Date()))).isFalse(); } private Collection<String> keys(List<Transition> transitions) { - return Collections2.transform(transitions, new Function<Transition, String>() { - @Override - public String apply(@Nullable Transition transition) { - return transition.key(); - } - }); + return transitions.stream().map(Transition::key).collect(MoreCollectors.toList()); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java index 463f1cd52f4..7b0659e69ef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/DoTransitionAction.java @@ -40,6 +40,7 @@ import org.sonar.server.user.UserSession; import static java.lang.String.format; import static org.sonar.api.issue.DefaultTransitions.OPEN_AS_VULNERABILITY; +import static org.sonar.api.issue.DefaultTransitions.RESET_AS_TO_REVIEW; import static org.sonar.api.issue.DefaultTransitions.RESOLVE_AS_REVIEWED; import static org.sonar.api.issue.DefaultTransitions.SET_AS_IN_REVIEW; import static org.sonarqube.ws.client.issue.IssuesWsParameters.ACTION_DO_TRANSITION; @@ -75,7 +76,7 @@ public class DoTransitionAction implements IssuesWsAction { "The transitions involving security hotspots require the permission 'Administer Security Hotspot'.") .setSince("3.6") .setChangelog( - new Change("7.8", format("added '%s', %s and %s transitions for security hotspots ", SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY)), + new Change("7.8", format("added '%s', %s, %s and %s transitions for security hotspots ", SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY, RESET_AS_TO_REVIEW)), new Change("7.3", "added transitions for security hotspots"), new Change("6.5", "the database ids of the components are removed from the response"), new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead.")) diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/BulkChangeActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/BulkChangeActionTest.java index 87631fb449e..127e87d2530 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/BulkChangeActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/BulkChangeActionTest.java @@ -345,7 +345,7 @@ public class BulkChangeActionTest { BulkChangeWsResponse response = call(builder() .setIssues(singletonList(issue.getKey())) - .setDoTransition("dismiss") + .setDoTransition("resetastoreview") .setSendNotifications(true) .build()); diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/empty.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/empty.json index e249486597c..efb9191e511 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/empty.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/empty.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -15,7 +15,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -25,7 +25,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 1 @@ -35,7 +35,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -45,7 +45,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -55,7 +55,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -65,7 +65,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -75,7 +75,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -85,7 +85,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -95,7 +95,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -105,7 +105,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 2 diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/owaspNoCwe.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/owaspNoCwe.json index 30e6a1057dc..60675e21b7b 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/owaspNoCwe.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/owaspNoCwe.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -16,7 +16,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1, + "reviewedSecurityHotspots": 1, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -26,7 +26,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 1 @@ -36,7 +36,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -46,7 +46,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -56,7 +56,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -66,7 +66,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -76,7 +76,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -86,7 +86,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -96,7 +96,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -106,7 +106,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 2 diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sansWithCwe.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sansWithCwe.json index 036ffff353d..ce510484551 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sansWithCwe.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sansWithCwe.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 1 @@ -15,7 +15,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -26,7 +26,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [ { "cwe": "89", @@ -34,7 +34,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "activeRules": 1, "totalRules": 1 } diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityNoCwe.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityNoCwe.json index 9d0acd1dc28..c00feb5f200 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityNoCwe.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityNoCwe.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -15,7 +15,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -25,7 +25,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -35,7 +35,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -45,7 +45,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -55,7 +55,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -65,7 +65,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -75,7 +75,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -85,7 +85,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -95,7 +95,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -105,7 +105,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -115,7 +115,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -126,7 +126,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1, + "reviewedSecurityHotspots": 1, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -136,7 +136,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -146,7 +146,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -156,7 +156,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -166,7 +166,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -176,7 +176,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -186,7 +186,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -196,7 +196,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityOnApplication.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityOnApplication.json index 258c0756f96..93df7186016 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityOnApplication.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityOnApplication.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -13,7 +13,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -21,7 +21,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -29,7 +29,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -37,7 +37,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -45,7 +45,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -53,7 +53,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -61,7 +61,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -69,7 +69,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -77,7 +77,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -85,7 +85,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -93,7 +93,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -102,7 +102,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1, + "reviewedSecurityHotspots": 1, "distribution": [ { "cwe": "89", @@ -110,7 +110,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1 + "reviewedSecurityHotspots": 1 } ] }, @@ -119,7 +119,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -127,7 +127,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -135,7 +135,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -143,7 +143,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -151,7 +151,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -159,7 +159,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] }, { @@ -167,7 +167,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [] } ] diff --git a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityWithCwe.json b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityWithCwe.json index 712067d6d7e..c9e6c748036 100644 --- a/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityWithCwe.json +++ b/server/sonar-server/src/test/resources/com/sonar/governance/securityreport/ws/ShowActionTest/sonarsourceSecurityWithCwe.json @@ -5,7 +5,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -15,7 +15,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -25,7 +25,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -35,7 +35,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -45,7 +45,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -55,7 +55,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -65,7 +65,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -75,7 +75,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -85,7 +85,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -95,7 +95,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -105,7 +105,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -115,7 +115,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -126,7 +126,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1, + "reviewedSecurityHotspots": 1, "distribution": [ { "cwe": "89", @@ -134,7 +134,7 @@ "vulnerabilityRating": 3, "inReviewSecurityHotspots": 1, "toReviewSecurityHotspots": 1, - "resolvedSecurityHotspots": 1, + "reviewedSecurityHotspots": 1, "activeRules": 1, "totalRules": 1 } @@ -147,7 +147,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -157,7 +157,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -167,7 +167,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -177,7 +177,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 @@ -187,7 +187,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -197,7 +197,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 1, "totalRules": 1 @@ -207,7 +207,7 @@ "vulnerabilities": 0, "inReviewSecurityHotspots": 0, "toReviewSecurityHotspots": 0, - "resolvedSecurityHotspots": 0, + "reviewedSecurityHotspots": 0, "distribution": [], "activeRules": 0, "totalRules": 0 |