Merge "AbstractElasticIndex: fix index name of delete request and add coverage" into stable-2.14
This commit is contained in:
commit
70428fc5da
@ -157,7 +157,7 @@ abstract class AbstractElasticIndex<K, V> implements Index<K, V> {
|
||||
protected abstract String getId(V v);
|
||||
|
||||
protected String delete(String type, K id) {
|
||||
return new DeleteRequest(id.toString(), indexNameRaw, type).toString();
|
||||
return new DeleteRequest(id.toString(), indexName, type).toString();
|
||||
}
|
||||
|
||||
protected void addNamedElement(String name, JsonObject element, JsonArray array) {
|
||||
|
@ -2205,6 +2205,18 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
||||
assertQuery("owner: \"" + nameEmail + "\"\\");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byDeletedChange() throws Exception {
|
||||
TestRepository<Repo> repo = createProject("repo");
|
||||
Change change = insert(repo, newChange(repo));
|
||||
|
||||
String query = "change:" + change.getId();
|
||||
assertQuery(query, change);
|
||||
|
||||
gApi.changes().id(change.getChangeId()).delete();
|
||||
assertQuery(query);
|
||||
}
|
||||
|
||||
protected ChangeInserter newChange(TestRepository<Repo> repo) throws Exception {
|
||||
return newChange(repo, null, null, null, null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user