aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-pushapi
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2022-09-20 11:59:16 -0500
committersonartech <sonartech@sonarsource.com>2022-10-12 20:03:43 +0000
commit566094fc629ab1e92afb0cdf191a0e2c685b5c35 (patch)
treece172266109cf1c4e81a041e460c6cc7bcd5d50e /server/sonar-webserver-pushapi
parentbcfb1cac55137b838da7a93385b20e0e5ed47abb (diff)
downloadsonarqube-566094fc629ab1e92afb0cdf191a0e2c685b5c35.tar.gz
sonarqube-566094fc629ab1e92afb0cdf191a0e2c685b5c35.zip
SONAR-17352 Refactor component keys to not include branch suffix
Diffstat (limited to 'server/sonar-webserver-pushapi')
-rw-r--r--server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImpl.java2
-rw-r--r--server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImplTest.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImpl.java b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImpl.java
index 2e0e7f9b223..b73efa13e76 100644
--- a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImpl.java
+++ b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImpl.java
@@ -106,7 +106,7 @@ public class IssueChangeEventServiceImpl implements IssueChangeEventService {
IssueChangedEvent event = getIssueChangedEvent(projectKey, issuesInProject, issueChanges);
if (event != null) {
- persistEvent(event, entry.getValue().projectUuid());
+ persistEvent(event, entry.getValue().branchUuid());
}
}
}
diff --git a/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImplTest.java b/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImplTest.java
index 4fd9b9626d2..e171ae1c4f0 100644
--- a/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImplTest.java
+++ b/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/issues/IssueChangeEventServiceImplTest.java
@@ -143,13 +143,13 @@ public class IssueChangeEventServiceImplTest {
Set<DefaultIssue> issues = Set.of(defaultIssue1, defaultIssue2, issue3.toDefaultIssue());
Map<String, ComponentDto> projectsByUuid = new HashMap<>();
- projectsByUuid.put(componentDto1.projectUuid(), componentDto1);
- projectsByUuid.put(componentDto2.projectUuid(), componentDto2);
- projectsByUuid.put(componentDto3.projectUuid(), componentDto3);
+ projectsByUuid.put(componentDto1.branchUuid(), componentDto1);
+ projectsByUuid.put(componentDto2.branchUuid(), componentDto2);
+ projectsByUuid.put(componentDto3.branchUuid(), componentDto3);
Map<String, BranchDto> branchesByProjectUuid = new HashMap<>();
- branchesByProjectUuid.put(componentDto1.projectUuid(), branch1);
- branchesByProjectUuid.put(componentDto2.projectUuid(), branch2);
- branchesByProjectUuid.put(componentDto3.projectUuid(), branch3);
+ branchesByProjectUuid.put(componentDto1.branchUuid(), branch1);
+ branchesByProjectUuid.put(componentDto2.branchUuid(), branch2);
+ branchesByProjectUuid.put(componentDto3.branchUuid(), branch3);
underTest.distributeIssueChangeEvent(issues, projectsByUuid, branchesByProjectUuid);
@@ -203,9 +203,9 @@ public class IssueChangeEventServiceImplTest {
Set<DefaultIssue> issues = Set.of(defaultIssue1);
Map<String, ComponentDto> projectsByUuid = new HashMap<>();
- projectsByUuid.put(project.projectUuid(), project);
+ projectsByUuid.put(project.branchUuid(), project);
Map<String, BranchDto> branchesByProjectUuid = new HashMap<>();
- branchesByProjectUuid.put(project.projectUuid(), branch1);
+ branchesByProjectUuid.put(project.branchUuid(), branch1);
underTest.distributeIssueChangeEvent(issues, projectsByUuid, branchesByProjectUuid);