|
|
@@ -22,6 +22,7 @@ import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
|
|
|
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
|
|
import org.junit.After;
|
|
|
import org.junit.Before;
|
|
|
+import org.junit.BeforeClass;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.Collection;
|
|
|
@@ -49,15 +50,21 @@ public abstract class MultipleProjectsClientYamlSuiteTestCase extends ESClientYa
|
|
|
*/
|
|
|
protected static final String PASS = Objects.requireNonNull(System.getProperty("tests.rest.cluster.password", "test-password"));
|
|
|
|
|
|
- // The active project-id is slightly longer, and has a fixed suffix so that it's easier to pick in error messages etc.
|
|
|
- private final String activeProject = randomAlphaOfLength(8).toLowerCase(Locale.ROOT) + "00active";
|
|
|
- private final Set<String> extraProjects = randomSet(1, 3, () -> randomAlphaOfLength(12).toLowerCase(Locale.ROOT));
|
|
|
- private boolean projectsConfigured = false;
|
|
|
+ private static String activeProject;
|
|
|
+ private static Set<String> extraProjects;
|
|
|
+ private static boolean projectsConfigured = false;
|
|
|
|
|
|
public MultipleProjectsClientYamlSuiteTestCase(ClientYamlTestCandidate testCandidate) {
|
|
|
super(testCandidate);
|
|
|
}
|
|
|
|
|
|
+ @BeforeClass
|
|
|
+ public static void initializeProjectIds() {
|
|
|
+ // The active project-id is slightly longer, and has a fixed suffix so that it's easier to pick in error messages etc.
|
|
|
+ activeProject = randomAlphaOfLength(8).toLowerCase(Locale.ROOT) + "00active";
|
|
|
+ extraProjects = randomSet(1, 3, () -> randomAlphaOfLength(12).toLowerCase(Locale.ROOT));
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected RestClient getCleanupClient() {
|
|
|
return client();
|