@@ -0,0 +1,2442 @@
+// Copyright (C) 2018 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.gerrit.elasticsearch;%0A%0Aimport com.google.gerrit.elasticsearch.ElasticTestUtils.ElasticNodeInfo;%0Aimport com.google.gerrit.server.query.project.AbstractQueryProjectsTest;%0Aimport com.google.gerrit.testing.ConfigSuite;%0Aimport com.google.gerrit.testing.InMemoryModule;%0Aimport com.google.gerrit.testing.IndexConfig;%0Aimport com.google.inject.Guice;%0Aimport com.google.inject.Injector;%0Aimport org.eclipse.jgit.lib.Config;%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0A%0Apublic class ElasticV5QueryProjectsTest extends AbstractQueryProjectsTest %7B%0A  @ConfigSuite.Default%0A  public static Config defaultConfig() %7B%0A    return IndexConfig.createForElasticsearch();%0A  %7D%0A%0A  private static ElasticNodeInfo nodeInfo;%0A  private static ElasticContainer%3C?%3E container;%0A%0A  @BeforeClass%0A  public static void startIndexService() %7B%0A    if (nodeInfo != null) %7B%0A      // do not start Elasticsearch twice%0A      return;%0A    %7D%0A%0A    container = ElasticContainer.createAndStart(ElasticVersion.V5_6);%0A    nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort());%0A  %7D%0A%0A  @AfterClass%0A  public static void stopElasticsearchServer() %7B%0A    if (container != null) %7B%0A      container.stop();%0A    %7D%0A  %7D%0A%0A  private String testName() %7B%0A    return testName.getMethodName().toLowerCase() + %22_%22;%0A  %7D%0A%0A  @Override%0A  protected void initAfterLifecycleStart() throws Exception %7B%0A    super.initAfterLifecycleStart();%0A    ElasticTestUtils.createAllIndexes(injector);%0A  %7D%0A%0A  @Override%0A  protected Injector createInjector() %7B%0A    Config elasticsearchConfig = new Config(config);%0A    InMemoryModule.setDefaults(elasticsearchConfig);%0A    String indicesPrefix = testName();%0A    ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);%0A    return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));%0A  %7D%0A%7D%0A

Add tests for project queries against version 5