aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-es/src/testFixtures
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2024-01-05 14:58:48 +0100
committersonartech <sonartech@sonarsource.com>2024-01-05 20:02:36 +0000
commitf8fd928e5a6627c245b85342af5f6d367f49eb28 (patch)
tree50284691970a1b66d793e6fb50330aa598680e0f /server/sonar-webserver-es/src/testFixtures
parent8c881ac397129bfef148499b85d047377a3c332f (diff)
downloadsonarqube-f8fd928e5a6627c245b85342af5f6d367f49eb28.tar.gz
sonarqube-f8fd928e5a6627c245b85342af5f6d367f49eb28.zip
SONAR-18963 Index peristed issues only
Diffstat (limited to 'server/sonar-webserver-es/src/testFixtures')
-rw-r--r--server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/FooIndexer.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/FooIndexer.java b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/FooIndexer.java
index d3b78b0e5f1..f8a09d3d175 100644
--- a/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/FooIndexer.java
+++ b/server/sonar-webserver-es/src/testFixtures/java/org/sonar/server/permission/index/FooIndexer.java
@@ -20,7 +20,6 @@
package org.sonar.server.permission.index;
import java.util.Optional;
-import java.util.Set;
import org.elasticsearch.action.index.IndexRequest;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -50,24 +49,17 @@ public class FooIndexer implements AnalysisIndexer, NeedAuthorizationIndexer {
@Override
public void indexOnAnalysis(String branchUuid) {
- indexOnAnalysis(branchUuid, Set.of());
- }
-
- @Override
- public void indexOnAnalysis(String branchUuid, Set<String> unchangedComponentUuids) {
- try(DbSession dbSession = dbClient.openSession(true)){
+ try (DbSession dbSession = dbClient.openSession(true)) {
Optional<BranchDto> branchDto = dbClient.branchDao().selectByUuid(dbSession, branchUuid);
if (branchDto.isEmpty()) {
//For portfolio, adding branchUuid directly
addToIndex(branchUuid, "bar");
addToIndex(branchUuid, "baz");
- }else{
+ } else {
addToIndex(branchDto.get().getProjectUuid(), "bar");
addToIndex(branchDto.get().getProjectUuid(), "baz");
}
}
-
-
}
private void addToIndex(String projectUuid, String name) {