ElasticTestUtils: reuse project index name constant
Similar to Ifc1244f5, but that change was made on stable-2.14, which did not yet have the project index. The refactoring outside of ElasticTestUtils was causing tests to fail. Change-Id: Ie8407b0304fde4db5e629fc9a8980005d6a9cf41
This commit is contained in:
@@ -54,7 +54,6 @@ public class ElasticProjectIndex extends AbstractElasticIndex<Project.NameKey, P
|
||||
}
|
||||
|
||||
static final String PROJECTS = "projects";
|
||||
static final String PROJECTS_PREFIX = PROJECTS + "_";
|
||||
|
||||
private final ProjectMapping mapping;
|
||||
private final Provider<ProjectCache> projectCache;
|
||||
@@ -66,7 +65,7 @@ public class ElasticProjectIndex extends AbstractElasticIndex<Project.NameKey, P
|
||||
Provider<ProjectCache> projectCache,
|
||||
JestClientBuilder clientBuilder,
|
||||
@Assisted Schema<ProjectData> schema) {
|
||||
super(cfg, sitePaths, schema, clientBuilder, PROJECTS_PREFIX);
|
||||
super(cfg, sitePaths, schema, clientBuilder, PROJECTS);
|
||||
this.projectCache = projectCache;
|
||||
this.mapping = new ProjectMapping(schema);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import static com.google.gerrit.elasticsearch.ElasticChangeIndex.CHANGES;
|
||||
import static com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES;
|
||||
import static com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES;
|
||||
import static com.google.gerrit.elasticsearch.ElasticGroupIndex.GROUPS;
|
||||
import static com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS_PREFIX;
|
||||
import static com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.io.Files;
|
||||
@@ -169,7 +169,7 @@ final class ElasticTestUtils {
|
||||
.client()
|
||||
.admin()
|
||||
.indices()
|
||||
.prepareCreate(String.format("%s%04d", PROJECTS_PREFIX, projectSchema.getVersion()))
|
||||
.prepareCreate(String.format("%s_%04d", PROJECTS, projectSchema.getVersion()))
|
||||
.addMapping(ElasticProjectIndex.PROJECTS, gson.toJson(projectMapping))
|
||||
.execute()
|
||||
.actionGet();
|
||||
|
Reference in New Issue
Block a user