Rename test cases to use new test name patterns

With elastic/elasticsearchelastic/elasticsearch#12623 base test classes were renamed
to use "TestCase" suffix. This updates x-plugins to reflect those
name changes. It also renames some tests that were marked
with @Slow (which was forbidden with elastic/elasticsearchelastic/elasticsearch#12617 and
elastic/elasticsearch elastic/elasticsearch#12618) to use the IT suffix to run
under `mvn verify`.

Original commit: elastic/x-pack-elasticsearch@05ffe2f202
This commit is contained in:
Ryan Ernst 2015-08-03 18:18:18 -07:00
parent 06862df7dd
commit ae02762b95
197 changed files with 509 additions and 542 deletions

View File

@ -9,14 +9,14 @@ import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.util.Collection;
import static org.hamcrest.Matchers.is;
public class MarvelPluginClientTests extends ElasticsearchTestCase {
public class MarvelPluginClientTests extends ESTestCase {
@Test
public void testModulesWithClientSettings() {

View File

@ -11,16 +11,16 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.plugin.LicensePlugin;
import org.elasticsearch.marvel.agent.AgentService;
import org.elasticsearch.plugins.PluginInfo;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.tribe.TribeService;
import org.junit.Test;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST;
import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
import static org.hamcrest.Matchers.equalTo;
@ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0)
public class MarvelPluginTests extends ElasticsearchIntegrationTest {
public class MarvelPluginTests extends ESIntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {

View File

@ -7,13 +7,13 @@ package org.elasticsearch.marvel;
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import org.elasticsearch.test.rest.ElasticsearchRestTestCase;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.test.rest.RestTestCandidate;
import org.elasticsearch.test.rest.parser.RestTestParseException;
import java.io.IOException;
public class MarvelRestIT extends ElasticsearchRestTestCase {
public class MarvelRestIT extends ESRestTestCase {
public MarvelRestIT(@Name("yaml") RestTestCandidate testCandidate) {
super(testCandidate);
@ -21,7 +21,7 @@ public class MarvelRestIT extends ElasticsearchRestTestCase {
@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, RestTestParseException {
return ElasticsearchRestTestCase.createParameters(0, 1);
return ESRestTestCase.createParameters(0, 1);
}
}

View File

@ -5,12 +5,12 @@
*/
package org.elasticsearch.marvel;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.equalTo;
public class MarvelVersionTests extends ElasticsearchTestCase {
public class MarvelVersionTests extends ESTestCase {
@Test
public void testVersionFromString() {

View File

@ -7,7 +7,7 @@ package org.elasticsearch.marvel.agent;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.marvel.agent.support.AgentUtils;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
public class AgentUtilsTests extends ElasticsearchTestCase {
public class AgentUtilsTests extends ESTestCase {
@Test
public void testVersionIsExtractableFromIndexTemplate() throws IOException {

View File

@ -12,7 +12,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;
import java.util.Collection;
@ -20,7 +20,7 @@ import java.util.Collection;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.*;
public class ClusterStateCollectorTests extends ElasticsearchSingleNodeTest {
public class ClusterStateCollectorTests extends ESSingleNodeTestCase {
@Test
public void testClusterStateCollectorNoIndices() throws Exception {

View File

@ -10,14 +10,14 @@ import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.junit.Test;
import java.util.Collection;
import static org.hamcrest.Matchers.*;
public class ClusterStatsCollectorTests extends ElasticsearchIntegrationTest {
public class ClusterStatsCollectorTests extends ESIntegTestCase {
@Test
public void testClusterStatsCollector() throws Exception {

View File

@ -5,7 +5,6 @@
*/
package org.elasticsearch.marvel.agent.collector.indices;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse;
import org.elasticsearch.cluster.ClusterName;
@ -17,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.junit.Test;
import java.util.Collection;
@ -32,9 +31,8 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.*;
@Slow
@ElasticsearchIntegrationTest.ClusterScope(numDataNodes = 0)
public class IndexRecoveryCollectorTests extends ElasticsearchIntegrationTest {
@ESIntegTestCase.ClusterScope(numDataNodes = 0)
public class IndexRecoveryCollectorIT extends ESIntegTestCase {
@Override

View File

@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;
import java.util.Collection;
@ -22,7 +22,7 @@ import java.util.Iterator;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.*;
public class IndexStatsCollectorTests extends ElasticsearchSingleNodeTest {
public class IndexStatsCollectorTests extends ESSingleNodeTestCase {
@Test
public void testIndexStatsCollectorNoIndices() throws Exception {

View File

@ -15,14 +15,14 @@ import org.elasticsearch.discovery.DiscoveryService;
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
import org.elasticsearch.node.service.NodeService;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.junit.Test;
import java.util.Collection;
import static org.hamcrest.Matchers.*;
public class NodeStatsCollectorTests extends ElasticsearchIntegrationTest {
public class NodeStatsCollectorTests extends ESIntegTestCase {
@Test
public void testNodeStatsCollector() throws Exception {

View File

@ -8,7 +8,6 @@ package org.elasticsearch.marvel.agent.exporter;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.admin.indices.stats.IndexStats;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.common.Strings;
@ -18,8 +17,8 @@ import org.elasticsearch.marvel.MarvelPlugin;
import org.elasticsearch.marvel.agent.AgentService;
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.hamcrest.Matchers;
import org.junit.Test;
@ -32,8 +31,8 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
// Transport Client instantiation also calls the marvel plugin, which then fails to find modules
@ClusterScope(transportClientRatio = 0.0, scope = ElasticsearchIntegrationTest.Scope.TEST, numDataNodes = 0, numClientNodes = 0)
public class HttpESExporterTests extends ElasticsearchIntegrationTest {
@ClusterScope(transportClientRatio = 0.0, scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0)
public class HttpESExporterTests extends ESIntegTestCase {
final static AtomicLong timeStampGenerator = new AtomicLong();
@ -84,7 +83,6 @@ public class HttpESExporterTests extends ElasticsearchIntegrationTest {
*/
@Test
@LuceneTestCase.Slow
public void testTemplateAdditionDespiteOfLateClusterForming() {
Settings.Builder builder = Settings.builder()
.put(AgentService.SETTINGS_INTERVAL, "200m")

View File

@ -15,10 +15,10 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMarvelDoc;
import org.elasticsearch.marvel.agent.renderer.Renderer;
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;
public class ClusterStateRendererTests extends ElasticsearchSingleNodeTest {
public class ClusterStateRendererTests extends ESSingleNodeTestCase {
private static final String SAMPLE_FILE = "/samples/marvel_cluster_state.json";

View File

@ -10,10 +10,10 @@ import org.elasticsearch.common.io.Streams;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMarvelDoc;
import org.elasticsearch.marvel.agent.renderer.Renderer;
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;
public class ClusterStatsRendererTests extends ElasticsearchSingleNodeTest {
public class ClusterStatsRendererTests extends ESSingleNodeTestCase {
private static final String SAMPLE_FILE = "/samples/marvel_cluster_stats.json";

View File

@ -16,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMarvelDoc;
import org.elasticsearch.marvel.agent.renderer.Renderer;
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.util.ArrayList;
@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IndexRecoveryRendererTests extends ElasticsearchTestCase {
public class IndexRecoveryRendererTests extends ESTestCase {
private static final String SAMPLE_FILE = "/samples/marvel_index_recovery.json";

View File

@ -15,10 +15,10 @@ import org.elasticsearch.index.store.StoreStats;
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
import org.elasticsearch.marvel.agent.renderer.Renderer;
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
public class IndexStatsRendererTests extends ElasticsearchTestCase {
public class IndexStatsRendererTests extends ESTestCase {
private static final String SAMPLE_FILE = "/samples/marvel_index_stats.json";

View File

@ -11,10 +11,10 @@ import org.elasticsearch.marvel.agent.collector.node.NodeStatsMarvelDoc;
import org.elasticsearch.marvel.agent.renderer.Renderer;
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
import org.elasticsearch.node.service.NodeService;
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
import org.elasticsearch.test.ESSingleNodeTestCase;
import org.junit.Test;
public class NodeStatsRendererTests extends ElasticsearchSingleNodeTest {
public class NodeStatsRendererTests extends ESSingleNodeTestCase {
private static final String SAMPLE_FILE = "/samples/marvel_node_stats.json";

View File

@ -7,13 +7,13 @@ package org.elasticsearch.marvel.agent.settings;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.equalTo;
public class MarvelSettingTests extends ElasticsearchTestCase {
public class MarvelSettingTests extends ESTestCase {
@Test
public void testBooleanMarvelSetting() {

View File

@ -8,13 +8,13 @@ package org.elasticsearch.marvel.agent.settings;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.equalTo;
public class MarvelSettingsServiceTests extends ElasticsearchTestCase {
public class MarvelSettingsServiceTests extends ESTestCase {
@Test
public void testMarvelSettingService() {

View File

@ -19,19 +19,19 @@ import org.elasticsearch.license.plugin.core.LicensesService;
import org.elasticsearch.marvel.MarvelPlugin;
import org.elasticsearch.marvel.mode.Mode;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
import static org.hamcrest.Matchers.equalTo;
@ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0)
public class LicenseIntegrationTests extends ElasticsearchIntegrationTest {
public class LicenseIntegrationTests extends ESIntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {

View File

@ -10,14 +10,9 @@ import org.elasticsearch.common.metrics.MeanMetric;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.junit.Ignore;
import java.util.concurrent.ThreadLocalRandom;
/**
*
*/
@Ignore
public class HasherBenchmark {
private static final int WARMING_ITERS = 1000;

View File

@ -13,7 +13,7 @@ import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
import org.junit.After;
@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.*;
/**
* a helper class that contains a couple of HTTP helper methods
*/
public abstract class AbstractPrivilegeTests extends ShieldIntegrationTest {
public abstract class AbstractPrivilegeTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.client.ShieldClient;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.BeforeClass;
import org.junit.Test;
@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class ClearRealmsCacheTests extends ShieldIntegrationTest {
public class ClearRealmsCacheTests extends ShieldIntegTestCase {
private static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));

View File

@ -20,8 +20,8 @@ import org.junit.Test;
import java.nio.file.Path;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST;
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
@ClusterScope(scope = TEST)
public class ClusterPrivilegeTests extends AbstractPrivilegeTests {

View File

@ -25,7 +25,7 @@ import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.shield.license.LicenseService;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.Test;
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class LicensingTests extends ShieldIntegrationTest {
public class LicensingTests extends ShieldIntegTestCase {
public static final String ROLES =
ShieldSettingsSource.DEFAULT_ROLE + ":\n" +

View File

@ -15,7 +15,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.Test;
@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitC
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.is;
public class MultipleIndicesPermissionsTests extends ShieldIntegrationTest {
public class MultipleIndicesPermissionsTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));

View File

@ -14,7 +14,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Test;
import java.util.List;
@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.hasSize;
* actions that are normally categorized as index actions as cluster actions - for example,
* index template actions.
*/
public class PermissionPrecedenceTests extends ShieldIntegrationTest {
public class PermissionPrecedenceTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));

View File

@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.shield.crypto.CryptoService;
import org.elasticsearch.shield.crypto.InternalCryptoService;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Test;
import java.util.Locale;
@ -22,7 +22,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationExcepti
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.*;
public class ScrollIdSigningTests extends ShieldIntegrationTest {
public class ScrollIdSigningTests extends ShieldIntegTestCase {
@Test
public void testSearchAndClearScroll() throws Exception {

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Test;
import static org.elasticsearch.client.Requests.searchRequest;
@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFa
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
public class SearchGetAndSuggestPermissionsTests extends ShieldIntegrationTest {
public class SearchGetAndSuggestPermissionsTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));

View File

@ -17,7 +17,7 @@ import org.elasticsearch.node.Node;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.ssl.AbstractSSLService;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -30,14 +30,14 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.is;
@ClusterScope(scope = SUITE)
public class SettingsFilterTests extends ShieldIntegrationTest {
public class SettingsFilterTests extends ShieldIntegTestCase {
private CloseableHttpClient httpClient = HttpClients.createDefault();

View File

@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.Before;
import org.junit.BeforeClass;
@ -24,7 +24,7 @@ import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basic
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
public class ShieldCachePermissionTests extends ShieldIntegrationTest {
public class ShieldCachePermissionTests extends ShieldIntegTestCase {
static final String READ_ONE_IDX_USER = "read_user";

View File

@ -14,7 +14,7 @@ import org.elasticsearch.action.search.MultiSearchResponse;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -27,7 +27,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertThro
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
public class ShieldClearScrollTests extends ShieldIntegrationTest {
public class ShieldClearScrollTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("change_me".toCharArray())));

View File

@ -17,8 +17,8 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
@ -39,9 +39,7 @@ import static org.hamcrest.Matchers.is;
* This test assumes all subclass tests will be of type SUITE. It picks a random realm configuration for the tests, and
* writes a group to role mapping file for each node.
*/
@Ignore
@ElasticsearchIntegrationTest.Integration
abstract public class AbstractAdLdapRealmTests extends ShieldIntegrationTest {
abstract public class AbstractAdLdapRealmTestCase extends ShieldIntegTestCase {
public static final String SHIELD_AUTHC_REALMS_EXTERNAL = "shield.authc.realms.external";
public static final String PASSWORD = "NickFuryHeartsES";

View File

@ -15,7 +15,7 @@ import java.io.IOException;
* The super class will provide appropriate group mappings via configGroupMappings()
*/
@Network
public class GroupMappingTests extends AbstractAdLdapRealmTests {
public class GroupMappingTests extends AbstractAdLdapRealmTestCase {
@Test
public void testAuthcAuthz() throws IOException {

View File

@ -14,7 +14,7 @@ import java.io.IOException;
* This tests the mapping of multiple groups to a role
*/
@Network
public class MultiGroupMappingTests extends AbstractAdLdapRealmTests {
public class MultiGroupMappingTests extends AbstractAdLdapRealmTestCase {
@Override
protected String configRoles() {

View File

@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.transport.ShieldServerTransportService;
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class ShieldPluginEnabledDisabledTests extends ShieldIntegrationTest {
public class ShieldPluginEnabledDisabledTests extends ShieldIntegTestCase {
private static boolean enabled;

View File

@ -6,14 +6,14 @@
package org.elasticsearch.shield;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.Matchers.arrayContaining;
public class ShieldPluginSettingsTests extends ElasticsearchTestCase {
public class ShieldPluginSettingsTests extends ESTestCase {
private static final String TRIBE_T1_SHIELD_ENABLED = "tribe.t1." + ShieldPlugin.ENABLED_SETTING_NAME;
private static final String TRIBE_T2_SHIELD_ENABLED = "tribe.t2." + ShieldPlugin.ENABLED_SETTING_NAME;

View File

@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -24,7 +24,7 @@ import static org.elasticsearch.rest.RestStatus.UNAUTHORIZED;
import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
import static org.hamcrest.Matchers.*;
public class ShieldPluginTests extends ShieldIntegrationTest {
public class ShieldPluginTests extends ShieldIntegTestCase {
@Override
public Settings nodeSettings(int nodeOrdinal) {

View File

@ -5,7 +5,7 @@
*/
package org.elasticsearch.shield;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.equalTo;
@ -14,7 +14,7 @@ import static org.hamcrest.Matchers.is;
/**
*
*/
public class ShieldVersionTests extends ElasticsearchTestCase {
public class ShieldVersionTests extends ESTestCase {
@Test
public void testStrings() throws Exception {

View File

@ -6,7 +6,7 @@
package org.elasticsearch.shield;
import org.elasticsearch.Version;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.is;
* In many cases we will just have to bump the version of the assert then, unless we want to break backwards compatibility, but the idea is that this class
* helps keeping track of this and eventually making changes when needed.
*/
public class VersionCompatibilityTests extends ElasticsearchTestCase {
public class VersionCompatibilityTests extends ESTestCase {
@Test
public void testCompatibility() {

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.shield.authz.AuthorizationService;
import org.elasticsearch.shield.crypto.CryptoService;
import org.elasticsearch.shield.license.LicenseEventsNotifier;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -29,7 +29,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class ShieldActionFilterTests extends ElasticsearchTestCase {
public class ShieldActionFilterTests extends ESTestCase {
private AuthenticationService authcService;
private AuthorizationService authzService;

View File

@ -9,7 +9,7 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.search.ClearScrollAction;
import org.elasticsearch.action.search.ClearScrollRequest;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.KnownActionsTests;
import org.junit.Test;
@ -19,7 +19,7 @@ import java.util.List;
import static org.hamcrest.CoreMatchers.equalTo;
public class ShieldActionMapperTests extends ElasticsearchTestCase {
public class ShieldActionMapperTests extends ESTestCase {
@Test
public void testThatAllOrdinaryActionsRemainTheSame() {

View File

@ -10,7 +10,7 @@ import org.elasticsearch.common.inject.Injector;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class AuditTrailModuleTests extends ElasticsearchTestCase {
public class AuditTrailModuleTests extends ESTestCase {
@Test
public void testEnabled() throws Exception {

View File

@ -12,7 +12,7 @@ import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.AuthenticationToken;
import org.elasticsearch.shield.transport.filter.IPFilter;
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportMessage;
import org.junit.Before;
import org.junit.Test;
@ -26,7 +26,7 @@ import static org.mockito.Mockito.verify;
/**
*
*/
public class AuditTrailServiceTests extends ElasticsearchTestCase {
public class AuditTrailServiceTests extends ESTestCase {
private Set<AuditTrail> auditTrails;
private AuditTrailService service;

View File

@ -5,7 +5,7 @@
*/
package org.elasticsearch.shield.audit.index;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.util.EnumSet;
@ -13,7 +13,7 @@ import java.util.Locale;
import static org.hamcrest.Matchers.*;
public class IndexAuditLevelTests extends ElasticsearchTestCase {
public class IndexAuditLevelTests extends ESTestCase {
@Test
public void testAllIndexAuditLevel() {

View File

@ -10,9 +10,9 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResp
import org.elasticsearch.action.exists.ExistsResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.Test;
@ -20,7 +20,7 @@ import org.junit.Test;
import static org.hamcrest.Matchers.*;
@ClusterScope(scope = Scope.TEST, randomDynamicTemplates = false)
public class IndexAuditTrailEnabledTests extends ShieldIntegrationTest {
public class IndexAuditTrailEnabledTests extends ShieldIntegTestCase {
IndexNameResolver.Rollover rollover = randomFrom(IndexNameResolver.Rollover.values());

View File

@ -28,9 +28,9 @@ import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.shield.authc.AuthenticationToken;
import org.elasticsearch.shield.transport.filter.IPFilter;
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalTestCluster;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.transport.TransportInfo;
import org.elasticsearch.transport.TransportMessage;
@ -49,7 +49,7 @@ import java.util.Locale;
import java.util.Map;
import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.*;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
import static org.elasticsearch.test.InternalTestCluster.clusterName;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
@ -61,8 +61,8 @@ import static org.mockito.Mockito.*;
/**
*
*/
@ElasticsearchIntegrationTest.ClusterScope(scope = SUITE, numDataNodes = 1)
public class IndexAuditTrailTests extends ShieldIntegrationTest {
@ESIntegTestCase.ClusterScope(scope = SUITE, numDataNodes = 1)
public class IndexAuditTrailTests extends ShieldIntegTestCase {
public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX;

View File

@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.test.InternalTestCluster;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.After;
import org.junit.Before;
@ -29,7 +29,7 @@ import static org.hamcrest.Matchers.is;
/**
* This test checks to ensure that the IndexAuditTrail starts properly when indexing to a remote cluster
*/
public class RemoteIndexAuditTrailStartingTests extends ShieldIntegrationTest {
public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase {
public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX;

View File

@ -20,7 +20,7 @@ import org.elasticsearch.shield.authc.AuthenticationToken;
import org.elasticsearch.shield.rest.RemoteHostHeader;
import org.elasticsearch.shield.transport.filter.IPFilter;
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportMessage;
import org.junit.Before;
import org.junit.Test;
@ -39,7 +39,7 @@ import static org.mockito.Mockito.when;
/**
*
*/
public class LoggingAuditTrailTests extends ElasticsearchTestCase {
public class LoggingAuditTrailTests extends ESTestCase {
private static enum RestContent {

View File

@ -9,14 +9,14 @@ import org.elasticsearch.common.io.stream.ByteBufferStreamInput;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.User;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.nio.ByteBuffer;
import static org.hamcrest.Matchers.*;
public class AnonymousUserHolderTests extends ElasticsearchTestCase {
public class AnonymousUserHolderTests extends ESTestCase {
@Test
public void testResolveAnonymousUser() throws Exception {

View File

@ -16,7 +16,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Test;
import java.io.InputStreamReader;
@ -24,7 +24,7 @@ import java.util.Locale;
import static org.hamcrest.Matchers.*;
public class AnonymousUserTests extends ShieldIntegrationTest {
public class AnonymousUserTests extends ShieldIntegTestCase {
private boolean authorizationExceptionsEnabled = randomBoolean();

View File

@ -19,7 +19,7 @@ import org.elasticsearch.shield.audit.AuditTrail;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.crypto.CryptoService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.transport.TransportMessage;
import org.junit.Before;
@ -39,7 +39,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class InternalAuthenticationServiceTests extends ElasticsearchTestCase {
public class InternalAuthenticationServiceTests extends ESTestCase {
@Rule
public ExpectedException thrown = ExpectedException.none();

View File

@ -11,7 +11,7 @@ import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.shield.ShieldSettingsFilter;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportMessage;
import org.junit.Before;
import org.junit.Test;
@ -24,7 +24,7 @@ import static org.mockito.Mockito.mock;
/**
*
*/
public class RealmsTests extends ElasticsearchTestCase {
public class RealmsTests extends ESTestCase {
private Map<String, Realm.Factory> factories;
private ShieldSettingsFilter settingsFilter;

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.ssl.ClientSSLService;
import org.elasticsearch.shield.support.NoOpLogger;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.After;
import org.junit.Before;
@ -30,7 +30,7 @@ import java.util.regex.Pattern;
import static org.hamcrest.Matchers.*;
@Network
public class ActiveDirectoryGroupsResolverTests extends ElasticsearchTestCase {
public class ActiveDirectoryGroupsResolverTests extends ESTestCase {
public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
private LDAPConnection ldapConnection;

View File

@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.support.*;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
@ -40,7 +40,7 @@ import static org.mockito.Mockito.*;
* The username used to authenticate then has to be in the form of CN=user. Finally the username needs to be added as an
* additional bind DN with a password in the test setup since it really is not a DN in the ldif file
*/
public class ActiveDirectoryRealmTests extends ElasticsearchTestCase {
public class ActiveDirectoryRealmTests extends ESTestCase {
private static final String PASSWORD = "password";

View File

@ -12,11 +12,11 @@ import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.ldap.LdapSessionFactory;
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
import org.elasticsearch.shield.authc.ldap.support.LdapTest;
import org.elasticsearch.shield.authc.ldap.support.LdapTestCase;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.ssl.ClientSSLService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.Before;
import org.junit.Test;
@ -29,7 +29,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthenticationExcept
import static org.hamcrest.Matchers.*;
@Network
public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
public class ActiveDirectorySessionFactoryTests extends ESTestCase {
public static final String AD_LDAP_URL = "ldaps://54.213.145.20:636";
public static final String PASSWORD = "NickFuryHeartsES";
@ -231,7 +231,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
public void testStandardLdapConnection() throws Exception {
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
Settings settings = LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE);
Settings settings = LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE);
RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings);
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
@ -250,7 +250,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
@Test @SuppressWarnings("unchecked")
public void testStandardLdapWithAttributeGroups() throws Exception {
String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
Settings settings = LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, false);
Settings settings = LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, false);
RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings);
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
@ -283,7 +283,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
String userTemplate = "CN={0},CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
Settings settings = Settings.builder()
.put(LdapTest.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE))
.put(LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.SUB_TREE))
.put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true)
.build();
RealmConfig config = new RealmConfig("ad-test", settings, globalSettings);

View File

@ -26,7 +26,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.hamcrest.Matchers;
@ -41,7 +41,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class ESUsersRealmTests extends ElasticsearchTestCase {
public class ESUsersRealmTests extends ESTestCase {
private RestController restController;
private Client client;

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.RefreshListener;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
@ -41,7 +41,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class FileUserPasswdStoreTests extends ElasticsearchTestCase {
public class FileUserPasswdStoreTests extends ESTestCase {
private Settings settings;
private Environment env;

View File

@ -15,7 +15,7 @@ import org.elasticsearch.env.Environment;
import org.elasticsearch.shield.audit.logfile.CapturingLogger;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.support.RefreshListener;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
@ -41,7 +41,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class FileUserRolesStoreTests extends ElasticsearchTestCase {
public class FileUserRolesStoreTests extends ESTestCase {
private Settings settings;
private Environment env;

View File

@ -10,7 +10,7 @@ import org.elasticsearch.rest.RestController;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.LdapTest;
import org.elasticsearch.shield.authc.ldap.support.LdapTestCase;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.authc.support.DnRoleMapper;
import org.elasticsearch.shield.authc.support.SecuredString;
@ -30,7 +30,7 @@ import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.*;
public class LdapRealmTests extends LdapTest {
public class LdapRealmTests extends LdapTestCase {
public static final String VALID_USER_TEMPLATE = "cn={0},ou=people,o=sevenSeas";
public static final String VALID_USERNAME = "Thomas Masterman Hardy";

View File

@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
import org.elasticsearch.shield.authc.ldap.support.LdapTest;
import org.elasticsearch.shield.authc.ldap.support.LdapTestCase;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
@ -23,7 +23,7 @@ import java.util.List;
import static org.hamcrest.Matchers.*;
public class LdapSessionFactoryTests extends LdapTest {
public class LdapSessionFactoryTests extends LdapTestCase {
private Settings globalSettings;

View File

@ -21,7 +21,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFactoryTests;
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
import org.elasticsearch.shield.authc.ldap.support.LdapTest;
import org.elasticsearch.shield.authc.ldap.support.LdapTestCase;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.ssl.ClientSSLService;
@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.*;
@ThreadLeakFilters(filters = {
LdapUserSearchSessionFactoryTests.BackgroundConnectThreadLeakFilter.class
})
public class LdapUserSearchSessionFactoryTests extends LdapTest {
public class LdapUserSearchSessionFactoryTests extends LdapTestCase {
private ClientSSLService clientSSLService;
private Settings globalSettings;
@ -260,7 +260,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest {
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
Settings settings = settingsBuilder()
.put(LdapTest.buildLdapSettings(ActiveDirectorySessionFactoryTests.AD_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE))
.put(LdapTestCase.buildLdapSettings(ActiveDirectorySessionFactoryTests.AD_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE))
.put("user_search.base_dn", userSearchBase)
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
.put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD)
@ -288,7 +288,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest {
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
RealmConfig config = new RealmConfig("oldap-test", settingsBuilder()
.put(LdapTest.buildLdapSettings(OpenLdapTests.OPEN_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(LdapTestCase.buildLdapSettings(OpenLdapTests.OPEN_LDAP_URL, Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put("user_search.base_dn", userSearchBase)
.put("bind_dn", "uid=blackwidow,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com")
.put("bind_password", OpenLdapTests.PASSWORD)
@ -396,7 +396,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest {
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
Settings ldapSettings = settingsBuilder()
.put(LdapTest.buildLdapSettings("ldaps://elastic.co:636", Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE))
.put(LdapTestCase.buildLdapSettings("ldaps://elastic.co:636", Strings.EMPTY_ARRAY, groupSearchBase, LdapSearchScope.SUB_TREE))
.put("user_search.base_dn", userSearchBase)
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
.put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD)

View File

@ -11,11 +11,11 @@ import org.elasticsearch.env.Environment;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
import org.elasticsearch.shield.authc.ldap.support.LdapTest;
import org.elasticsearch.shield.authc.ldap.support.LdapTestCase;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.authc.support.SecuredStringTests;
import org.elasticsearch.shield.ssl.ClientSSLService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.Before;
import org.junit.Test;
@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItem;
@Network
public class OpenLdapTests extends ElasticsearchTestCase {
public class OpenLdapTests extends ESTestCase {
public static final String OPEN_LDAP_URL = "ldaps://54.200.235.244:636";
public static final String PASSWORD = "NickFuryHeartsES";
@ -57,7 +57,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
//openldap does not use cn as naming attributes by default
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
RealmConfig config = new RealmConfig("oldap-test", LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL), globalSettings);
RealmConfig config = new RealmConfig("oldap-test", LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL), globalSettings);
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" };
@ -74,7 +74,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
String groupSearchBase = "cn=Avengers,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
RealmConfig config = new RealmConfig("oldap-test", LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.BASE), globalSettings);
RealmConfig config = new RealmConfig("oldap-test", LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.BASE), globalSettings);
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" };
@ -90,7 +90,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
Settings settings = Settings.builder()
.put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put("group_search.filter", "(&(objectclass=posixGroup)(memberUID={0}))")
.put("group_search.user_attribute", "uid")
.build();
@ -108,7 +108,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
Settings settings = Settings.builder()
.put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(SessionFactory.HOSTNAME_VERIFICATION_SETTING, false)
.put(SessionFactory.TIMEOUT_TCP_READ_SETTING, "1ms") //1 millisecond
.build();
@ -130,7 +130,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
Settings settings = Settings.builder()
.put(LdapTest.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(LdapTestCase.buildLdapSettings(OPEN_LDAP_URL, userTemplate, groupSearchBase, LdapSearchScope.ONE_LEVEL))
.put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true)
.build();

View File

@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.ssl.ClientSSLService;
import org.elasticsearch.shield.support.NoOpLogger;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.After;
import org.junit.Before;
@ -29,7 +29,7 @@ import java.util.List;
import static org.hamcrest.Matchers.*;
@Network
public class SearchGroupsResolverTests extends ElasticsearchTestCase {
public class SearchGroupsResolverTests extends ESTestCase {
public static final String BRUCE_BANNER_DN = "uid=hulk,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";

View File

@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFact
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
import org.elasticsearch.shield.ssl.ClientSSLService;
import org.elasticsearch.shield.support.NoOpLogger;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.After;
import org.junit.Before;
@ -28,7 +28,7 @@ import java.util.List;
import static org.hamcrest.Matchers.*;
@Network
public class UserAttributeGroupsResolverTests extends ElasticsearchTestCase {
public class UserAttributeGroupsResolverTests extends ESTestCase {
public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
private LDAPConnection ldapConnection;

View File

@ -5,13 +5,13 @@
*/
package org.elasticsearch.shield.authc.ldap.support;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
public class LDAPServersTests extends ElasticsearchTestCase {
public class LDAPServersTests extends ESTestCase {
@Test
public void testConfigure_1ldaps() {

View File

@ -13,16 +13,16 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.ldap.LdapRealm;
import org.elasticsearch.shield.authc.support.DnRoleMapper;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.*;
import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING;
import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.URLS_SETTING;
import static org.elasticsearch.shield.authc.ldap.LdapSessionFactory.USER_DN_TEMPLATES_SETTING;
@Ignore
public abstract class LdapTest extends ElasticsearchTestCase {
public abstract class LdapTestCase extends ESTestCase {
protected InMemoryDirectoryServer ldapServer;

View File

@ -11,13 +11,13 @@ import com.unboundid.util.ssl.TrustAllSSLSocketVerifier;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.*;
public class SessionFactoryTests extends ElasticsearchTestCase {
public class SessionFactoryTests extends ESTestCase {
@Test
public void connectionFactoryReturnsCorrectLDAPConnectionOptionsWithDefaultSettings() {

View File

@ -20,8 +20,8 @@ import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.node.Node;
import org.elasticsearch.shield.transport.SSLClientAuth;
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.transport.Transport;
import org.junit.Test;
@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.*;
* Test authentication via PKI on both REST and Transport layers
*/
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
public class PkiAuthenticationTests extends ShieldIntegrationTest {
public class PkiAuthenticationTests extends ShieldIntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {

View File

@ -11,14 +11,13 @@ import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.license.plugin.LicensePlugin;
import org.elasticsearch.node.Node;
import org.elasticsearch.shield.ShieldPlugin;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.transport.SSLClientAuth;
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -38,7 +37,7 @@ import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_PASSWORD;
import static org.elasticsearch.test.ShieldSettingsSource.DEFAULT_USER_NAME;
import static org.hamcrest.Matchers.is;
public class PkiOptionalClientAuthTests extends ShieldIntegrationTest {
public class PkiOptionalClientAuthTests extends ShieldIntegTestCase {
private static int randomClientPort;

View File

@ -13,7 +13,7 @@ import org.elasticsearch.shield.authc.support.DnRoleMapper;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.support.NoOpLogger;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.transport.TransportMessage;
import org.junit.Before;
@ -31,7 +31,7 @@ import java.util.regex.Pattern;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
public class PkiRealmTests extends ElasticsearchTestCase {
public class PkiRealmTests extends ESTestCase {
private Settings globalSettings;

View File

@ -18,8 +18,8 @@ import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.shield.transport.SSLClientAuth;
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -35,7 +35,7 @@ import java.util.Locale;
import static org.hamcrest.Matchers.is;
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
public class PkiWithoutClientAuthenticationTests extends ShieldIntegrationTest {
public class PkiWithoutClientAuthenticationTests extends ShieldIntegTestCase {
private TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {

View File

@ -13,8 +13,8 @@ import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.node.Node;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
import org.elasticsearch.test.rest.client.http.HttpResponse;
@ -23,7 +23,7 @@ import org.junit.Test;
import static org.hamcrest.Matchers.is;
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
public class PkiWithoutSSLTests extends ShieldIntegrationTest {
public class PkiWithoutSSLTests extends ShieldIntegTestCase {
@Override
public boolean sslTransportEnabled() {

View File

@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.Realm;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import static org.hamcrest.Matchers.*;
public class CachingUsernamePasswordRealmTests extends ElasticsearchTestCase {
public class CachingUsernamePasswordRealmTests extends ESTestCase {
private Settings globalSettings;

View File

@ -15,7 +15,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger;
import org.elasticsearch.shield.authc.RealmConfig;
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectoryRealm;
import org.elasticsearch.shield.authc.ldap.LdapRealm;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class DnRoleMapperTests extends ElasticsearchTestCase {
public class DnRoleMapperTests extends ESTestCase {
private static final String[] STARK_GROUP_DNS = new String[] {
//groups can be named by different attributes, depending on the directory,

View File

@ -5,7 +5,7 @@
*/
package org.elasticsearch.shield.authc.support;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.sameInstance;
@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.sameInstance;
/**
*
*/
public class HasherTests extends ElasticsearchTestCase {
public class HasherTests extends ESTestCase {
@Test
public void testBcryptFamily_SelfGenerated() throws Exception {

View File

@ -5,14 +5,14 @@
*/
package org.elasticsearch.shield.authc.support;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.nio.charset.StandardCharsets;
import static org.hamcrest.Matchers.*;
public class SecuredStringTests extends ElasticsearchTestCase {
public class SecuredStringTests extends ESTestCase {
public static SecuredString build(String password){
return new SecuredString(password.toCharArray());
}

View File

@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
import org.elasticsearch.ElasticsearchSecurityException;
import org.elasticsearch.common.Base64;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.junit.Rule;
import org.junit.Test;
@ -23,7 +23,7 @@ import static org.mockito.Mockito.when;
/**
*
*/
public class UsernamePasswordTokenTests extends ElasticsearchTestCase {
public class UsernamePasswordTokenTests extends ESTestCase {
@Rule
public ExpectedException thrown = ExpectedException.none();

View File

@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz;
import org.elasticsearch.ElasticsearchSecurityException;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Test;
import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER;
@ -16,7 +16,7 @@ import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basic
import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException;
import static org.hamcrest.CoreMatchers.containsString;
public class AnalyzeTests extends ShieldIntegrationTest {
public class AnalyzeTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));

View File

@ -13,7 +13,7 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.shield.authc.support.Hasher;
import org.elasticsearch.shield.authc.support.SecuredString;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.junit.Before;
import org.junit.Test;
@ -23,7 +23,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationExcepti
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.CoreMatchers.*;
public class IndexAliasesTests extends ShieldIntegrationTest {
public class IndexAliasesTests extends ShieldIntegTestCase {
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));

View File

@ -25,7 +25,7 @@ import org.elasticsearch.shield.User;
import org.elasticsearch.shield.audit.AuditTrail;
import org.elasticsearch.shield.authc.AnonymousService;
import org.elasticsearch.shield.authz.store.RolesStore;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.junit.Before;
import org.junit.Test;
@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
public class InternalAuthorizationServiceTests extends ElasticsearchTestCase {
public class InternalAuthorizationServiceTests extends ESTestCase {
private AuditTrail auditTrail;
private RolesStore rolesStore;

View File

@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import org.elasticsearch.action.get.GetAction;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class PermissionTests extends ElasticsearchTestCase {
public class PermissionTests extends ESTestCase {
private Permission.Global.Role permission;

View File

@ -13,7 +13,7 @@ import org.elasticsearch.action.search.SearchAction;
import org.elasticsearch.action.suggest.SuggestAction;
import org.elasticsearch.shield.support.AutomatonPredicate;
import org.elasticsearch.shield.support.Automatons;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@ -23,7 +23,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class PrivilegeTests extends ElasticsearchTestCase {
public class PrivilegeTests extends ESTestCase {
@Rule
public ExpectedException thrown = ExpectedException.none();

View File

@ -5,7 +5,7 @@
*/
package org.elasticsearch.shield.authz;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
@ -13,7 +13,7 @@ import static org.hamcrest.Matchers.is;
/**
*
*/
public class SystemRoleTests extends ElasticsearchTestCase {
public class SystemRoleTests extends ESTestCase {
@Test
public void testCheck() throws Exception {

View File

@ -29,7 +29,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authz.AuthorizationService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class DefaultIndicesResolverTests extends ElasticsearchTestCase {
public class DefaultIndicesResolverTests extends ESTestCase {
private User user;
private User userNoIndices;

View File

@ -14,7 +14,7 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.Requests;
import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.junit.Test;
@ -24,7 +24,7 @@ import java.util.List;
import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException;
import static org.hamcrest.CoreMatchers.*;
public class IndicesResolverIntegrationTests extends ShieldIntegrationTest {
public class IndicesResolverIntegrationTests extends ShieldIntegTestCase {
@Override
protected String configRoles() {

View File

@ -14,7 +14,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger;
import org.elasticsearch.shield.authc.support.RefreshListener;
import org.elasticsearch.shield.authz.Permission;
import org.elasticsearch.shield.authz.Privilege;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.Test;
@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class FileRolesStoreTests extends ElasticsearchTestCase {
public class FileRolesStoreTests extends ESTestCase {
@Test
public void testParseFile() throws Exception {

View File

@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.junit.After;
@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.*;
/**
*
*/
public class InternalCryptoServiceTests extends ElasticsearchTestCase {
public class InternalCryptoServiceTests extends ESTestCase {
private ResourceWatcherService watcherService;
private Settings settings;

View File

@ -13,7 +13,7 @@ import org.elasticsearch.rest.RestFilterChain;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -24,7 +24,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class ShieldRestFilterTests extends ElasticsearchTestCase {
public class ShieldRestFilterTests extends ESTestCase {
private AuthenticationService authcService;
private RestChannel channel;

View File

@ -12,7 +12,7 @@ import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.junit.Before;
import org.junit.Test;
@ -26,7 +26,7 @@ import java.util.List;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.*;
public class ClientSSLServiceTests extends ElasticsearchTestCase {
public class ClientSSLServiceTests extends ESTestCase {
Environment env;
Path testclientStore;

View File

@ -8,7 +8,7 @@ package org.elasticsearch.shield.ssl;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.shield.ssl.AbstractSSLService.SSLSettings;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import javax.net.ssl.KeyManagerFactory;
@ -17,7 +17,7 @@ import javax.net.ssl.TrustManagerFactory;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.*;
public class SSLSettingsTests extends ElasticsearchTestCase {
public class SSLSettingsTests extends ESTestCase {
@Test
public void testThatSSLSettingsWithEmptySettingsHaveCorrectDefaults() {

View File

@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.shield.ShieldSettingsFilter;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import org.junit.Test;
@ -24,7 +24,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.mock;
public class ServerSSLServiceTests extends ElasticsearchTestCase {
public class ServerSSLServiceTests extends ESTestCase {
Path testnodeStore;
ShieldSettingsFilter settingsFilter;

View File

@ -7,7 +7,7 @@ package org.elasticsearch.shield.support;
import dk.brics.automaton.Automaton;
import dk.brics.automaton.RunAutomaton;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import static org.elasticsearch.shield.support.Automatons.*;
@ -16,7 +16,7 @@ import static org.hamcrest.Matchers.is;
/**
*
*/
public class AutomatonsTests extends ElasticsearchTestCase {
public class AutomatonsTests extends ESTestCase {
@Test
public void testPatterns_UnionOfMultiplePatterns() throws Exception {

View File

@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
import com.google.common.collect.Sets;
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.io.PrintWriter;
@ -25,7 +25,7 @@ import static java.nio.file.attribute.PosixFilePermission.*;
import static org.elasticsearch.shield.support.ShieldFiles.openAtomicMoveWriter;
import static org.hamcrest.Matchers.*;
public class ShieldFilesTests extends ElasticsearchTestCase {
public class ShieldFilesTests extends ESTestCase {
@Test
public void testThatOriginalPermissionsAreKept() throws Exception {

View File

@ -5,7 +5,7 @@
*/
package org.elasticsearch.shield.support;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.junit.Test;
import java.util.Arrays;
@ -18,7 +18,7 @@ import static org.hamcrest.Matchers.nullValue;
/**
*
*/
public class ValidationTests extends ElasticsearchTestCase {
public class ValidationTests extends ESTestCase {
private static final char[] alphabet = {

View File

@ -7,7 +7,7 @@ package org.elasticsearch.shield.transport;
import org.elasticsearch.shield.User;
import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.junit.Before;
import org.junit.Test;
@ -18,7 +18,7 @@ import static org.mockito.Mockito.verify;
/**
*
*/
public class ClientTransportFilterTests extends ElasticsearchTestCase {
public class ClientTransportFilterTests extends ESTestCase {
private AuthenticationService authcService;
private ClientTransportFilter filter;

View File

@ -17,7 +17,7 @@ import org.elasticsearch.node.Node;
import org.elasticsearch.shield.ShieldPlugin;
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
import org.elasticsearch.shield.crypto.InternalCryptoService;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.test.ShieldSettingsSource;
import org.elasticsearch.transport.Transport;
import org.junit.BeforeClass;
@ -34,7 +34,7 @@ import static org.elasticsearch.shield.test.ShieldTestUtils.writeFile;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
public class ServerTransportFilterIntegrationTests extends ShieldIntegrationTest {
public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase {
private static int randomClientPort;

View File

@ -10,7 +10,7 @@ import org.elasticsearch.shield.User;
import org.elasticsearch.shield.action.ShieldActionMapper;
import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.shield.authz.AuthorizationService;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.elasticsearch.transport.netty.NettyTransport;
import org.elasticsearch.transport.netty.NettyTransportChannel;
@ -25,7 +25,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class ServerTransportFilterTests extends ElasticsearchTestCase {
public class ServerTransportFilterTests extends ESTestCase {
private AuthenticationService authcService;
private AuthorizationService authzService;

View File

@ -18,7 +18,7 @@ import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.shield.action.ShieldActionMapper;
import org.elasticsearch.shield.authc.AuthenticationService;
import org.elasticsearch.shield.authz.AuthorizationService;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.*;
import org.elasticsearch.transport.netty.NettyTransport;
@ -33,8 +33,8 @@ import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.*;
@ -43,7 +43,7 @@ import static org.mockito.Mockito.*;
*
*/
@ClusterScope(scope = SUITE, numDataNodes = 0)
public class TransportFilterTests extends ElasticsearchIntegrationTest {
public class TransportFilterTests extends ESIntegTestCase {
@Override
protected Settings nodeSettings(int nodeOrdinal) {

View File

@ -14,7 +14,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.node.settings.NodeSettingsService;
import org.elasticsearch.shield.audit.AuditTrail;
import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.junit.annotations.Network;
import org.elasticsearch.transport.Transport;
import org.junit.Before;
@ -31,7 +31,7 @@ import static org.mockito.Mockito.*;
/**
*
*/
public class IPFilterTests extends ElasticsearchTestCase {
public class IPFilterTests extends ESTestCase {
private IPFilter ipFilter;
private AuditTrail auditTrail;

View File

@ -12,7 +12,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.node.Node;
import org.elasticsearch.test.ShieldIntegrationTest;
import org.elasticsearch.test.ShieldIntegTestCase;
import org.elasticsearch.transport.Transport;
import org.junit.BeforeClass;
import org.junit.Test;
@ -22,14 +22,14 @@ import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import static org.elasticsearch.test.ESIntegTestCase.Scope;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
// no client nodes, no transport clients, as they all get rejected on network connections
@ClusterScope(scope = Scope.SUITE, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0)
public class IpFilteringIntegrationTests extends ShieldIntegrationTest {
public class IpFilteringIntegrationTests extends ShieldIntegTestCase {
private static int randomClientPort;

Some files were not shown because too many files have changed in this diff Show More