Remove redundant "testName" methods from Elasticsearch tests
All the Elasticsearch test classes inherit from GerritBaseTests, which has a getSanitizedMethodName method. Remove the testName methods defined in all of the test classes, and use getSanitizedMethodName instead. Change-Id: Ie834a087130fdecffd8bdc6eaa72fe53ab91d6eb
This commit is contained in:
@@ -45,10 +45,6 @@ public class ElasticV5QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV5QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(
|
||||
elasticsearchConfig, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV5QueryChangesTest extends AbstractQueryChangesTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV5QueryChangesTest extends AbstractQueryChangesTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(
|
||||
elasticsearchConfig, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV5QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV5QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(
|
||||
elasticsearchConfig, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV6QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV6QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
@@ -46,10 +46,6 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -60,7 +56,7 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV6QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV6QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV7QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV7QueryAccountsTest extends AbstractQueryAccountsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
@@ -46,10 +46,6 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -60,7 +56,7 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,6 @@ public class ElasticV7QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
}
|
||||
}
|
||||
|
||||
private String testName() {
|
||||
return testName.getMethodName().toLowerCase() + "_";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAfterLifecycleStart() throws Exception {
|
||||
super.initAfterLifecycleStart();
|
||||
@@ -59,7 +55,7 @@ public class ElasticV7QueryGroupsTest extends AbstractQueryGroupsTest {
|
||||
protected Injector createInjector() {
|
||||
Config elasticsearchConfig = new Config(config);
|
||||
InMemoryModule.setDefaults(elasticsearchConfig);
|
||||
String indicesPrefix = testName();
|
||||
String indicesPrefix = getSanitizedMethodName();
|
||||
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
|
||||
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user