aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao/src/testFixtures/java
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2022-06-21 16:44:20 +0200
committersonartech <sonartech@sonarsource.com>2022-06-22 16:09:14 +0000
commit308e3b537734beb775c9dff31f67b7cbadba8b08 (patch)
tree7be8ae205b9ea353274534a22fda7db11bc90aa6 /server/sonar-db-dao/src/testFixtures/java
parent5d2cc92609ee308d456c914705869536b209fc2b (diff)
downloadsonarqube-308e3b537734beb775c9dff31f67b7cbadba8b08.tar.gz
sonarqube-308e3b537734beb775c9dff31f67b7cbadba8b08.zip
SONAR-16542 fixed an issue where rule repo key was not returned
Diffstat (limited to 'server/sonar-db-dao/src/testFixtures/java')
-rw-r--r--server/sonar-db-dao/src/testFixtures/java/org/sonar/db/issue/IssueDbTester.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/issue/IssueDbTester.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/issue/IssueDbTester.java
index e57b9166489..fca2debffd2 100644
--- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/issue/IssueDbTester.java
+++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/issue/IssueDbTester.java
@@ -126,9 +126,19 @@ public class IssueDbTester {
@SafeVarargs
public final IssueDto insertIssue(Consumer<IssueDto>... populators) {
RuleDto rule = db.rules().insertIssueRule();
+ return insertIssue(rule, populators);
+ }
+
+ /**
+ * Inserts an issue.
+ *
+ * @throws AssertionError if rule is not Security Hotspot
+ */
+ @SafeVarargs
+ public final IssueDto insertIssue(RuleDto ruleDto, Consumer<IssueDto>... populators) {
ComponentDto project = db.components().insertPrivateProject();
ComponentDto file = db.components().insertComponent(newFileDto(project));
- IssueDto issue = newIssue(rule, project, file)
+ IssueDto issue = newIssue(ruleDto, project, file)
.setType(RULE_TYPES_EXCEPT_HOTSPOTS[new Random().nextInt(RULE_TYPES_EXCEPT_HOTSPOTS.length)]);
stream(populators).forEach(p -> p.accept(issue));
return insertIssue(issue);