aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-ce-task-projectanalysis
diff options
context:
space:
mode:
authorlukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com>2023-10-13 14:03:18 +0200
committersonartech <sonartech@sonarsource.com>2023-10-16 20:02:49 +0000
commit53d745f5ab9fee51e251d3f0c8998b18b1a34ab4 (patch)
treef339e0f51e247399651ef6b43ec0ccae0ce4197e /server/sonar-ce-task-projectanalysis
parent5eb9e5ac994e4cec622cbd64f6236bad098a0433 (diff)
downloadsonarqube-53d745f5ab9fee51e251d3f0c8998b18b1a34ab4.tar.gz
sonarqube-53d745f5ab9fee51e251d3f0c8998b18b1a34ab4.zip
SONAR-20317 fixed the issue where creating a portfolio would insert two entries into audit table
Diffstat (limited to 'server/sonar-ce-task-projectanalysis')
-rw-r--r--server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/ComponentUuidFactoryImplIT.java4
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImplTest.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/ComponentUuidFactoryImplIT.java b/server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/ComponentUuidFactoryImplIT.java
index 6da6104b038..e3d7f74307a 100644
--- a/server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/ComponentUuidFactoryImplIT.java
+++ b/server/sonar-ce-task-projectanalysis/src/it/java/org/sonar/ce/task/projectanalysis/component/ComponentUuidFactoryImplIT.java
@@ -100,9 +100,9 @@ public class ComponentUuidFactoryImplIT {
@Test
public void getOrCreateForKey_whenNoExistingComponentsInDbForPortfolioAndSubPortfolio_shouldLoadUuidFromPortfolioTable() {
PortfolioDto portfolioDto = ComponentTesting.newPortfolioDto("uuid_ptf1", "ptf1", "Portfolio1", null);
- db.getDbClient().portfolioDao().insert(db.getSession(), portfolioDto);
+ db.getDbClient().portfolioDao().insertWithAudit(db.getSession(), portfolioDto);
PortfolioDto subPortfolio = ComponentTesting.newPortfolioDto("subPtf1", "sub_ptf_1", "portfolio", portfolioDto);
- db.getDbClient().portfolioDao().insert(db.getSession(), subPortfolio);
+ db.getDbClient().portfolioDao().insertWithAudit(db.getSession(), subPortfolio);
ComponentUuidFactory underTest = new ComponentUuidFactoryImpl(db.getDbClient(), db.getSession(), portfolioDto.getKey());
diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImplTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImplTest.java
index 1c225bdef74..72cdeadec99 100644
--- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImplTest.java
+++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImplTest.java
@@ -94,7 +94,7 @@ public class AnticipatedTransitionRepositoryImplTest {
dbClient.branchDao().insert(db.getSession(), branchDto);
ComponentDto fileDto = getComponentDto(projectKey + ":" + mainFile, branchDto.getUuid());
- dbClient.componentDao().insertOnMainBranch(db.getSession(), fileDto);
+ dbClient.componentDao().insertWithAudit(db.getSession(), fileDto);
insertAnticipatedTransition(projectUuid, mainFile);
insertAnticipatedTransition(projectUuid, "file2.js");