Merge pull request elastic/elasticsearch#380 from rjernst/fix/test-renames
Rename test cases to use new test name patterns Original commit: elastic/x-pack-elasticsearch@e07ce966f4
This commit is contained in:
commit
402c55c739
|
@ -9,14 +9,14 @@ import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.common.inject.Module;
|
import org.elasticsearch.common.inject.Module;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class MarvelPluginClientTests extends ElasticsearchTestCase {
|
public class MarvelPluginClientTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testModulesWithClientSettings() {
|
public void testModulesWithClientSettings() {
|
||||||
|
|
|
@ -11,16 +11,16 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
import org.elasticsearch.license.plugin.LicensePlugin;
|
||||||
import org.elasticsearch.marvel.agent.AgentService;
|
import org.elasticsearch.marvel.agent.AgentService;
|
||||||
import org.elasticsearch.plugins.PluginInfo;
|
import org.elasticsearch.plugins.PluginInfo;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.tribe.TribeService;
|
import org.elasticsearch.tribe.TribeService;
|
||||||
import org.junit.Test;
|
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;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
@ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0)
|
@ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0)
|
||||||
public class MarvelPluginTests extends ElasticsearchIntegrationTest {
|
public class MarvelPluginTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
|
|
@ -7,13 +7,13 @@ package org.elasticsearch.marvel;
|
||||||
|
|
||||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
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.RestTestCandidate;
|
||||||
import org.elasticsearch.test.rest.parser.RestTestParseException;
|
import org.elasticsearch.test.rest.parser.RestTestParseException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class MarvelRestIT extends ElasticsearchRestTestCase {
|
public class MarvelRestIT extends ESRestTestCase {
|
||||||
|
|
||||||
public MarvelRestIT(@Name("yaml") RestTestCandidate testCandidate) {
|
public MarvelRestIT(@Name("yaml") RestTestCandidate testCandidate) {
|
||||||
super(testCandidate);
|
super(testCandidate);
|
||||||
|
@ -21,7 +21,7 @@ public class MarvelRestIT extends ElasticsearchRestTestCase {
|
||||||
|
|
||||||
@ParametersFactory
|
@ParametersFactory
|
||||||
public static Iterable<Object[]> parameters() throws IOException, RestTestParseException {
|
public static Iterable<Object[]> parameters() throws IOException, RestTestParseException {
|
||||||
return ElasticsearchRestTestCase.createParameters(0, 1);
|
return ESRestTestCase.createParameters(0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.marvel;
|
package org.elasticsearch.marvel;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class MarvelVersionTests extends ElasticsearchTestCase {
|
public class MarvelVersionTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionFromString() {
|
public void testVersionFromString() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.elasticsearch.marvel.agent;
|
||||||
|
|
||||||
import org.elasticsearch.common.io.Streams;
|
import org.elasticsearch.common.io.Streams;
|
||||||
import org.elasticsearch.marvel.agent.support.AgentUtils;
|
import org.elasticsearch.marvel.agent.support.AgentUtils;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.hamcrest.MatcherAssert;
|
import org.hamcrest.MatcherAssert;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.not;
|
||||||
|
|
||||||
|
|
||||||
public class AgentUtilsTests extends ElasticsearchTestCase {
|
public class AgentUtilsTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersionIsExtractableFromIndexTemplate() throws IOException {
|
public void testVersionIsExtractableFromIndexTemplate() throws IOException {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
||||||
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -20,7 +20,7 @@ import java.util.Collection;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ClusterStateCollectorTests extends ElasticsearchSingleNodeTest {
|
public class ClusterStateCollectorTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testClusterStateCollectorNoIndices() throws Exception {
|
public void testClusterStateCollectorNoIndices() throws Exception {
|
||||||
|
|
|
@ -10,14 +10,14 @@ import org.elasticsearch.cluster.ClusterService;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ClusterStatsCollectorTests extends ElasticsearchIntegrationTest {
|
public class ClusterStatsCollectorTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testClusterStatsCollector() throws Exception {
|
public void testClusterStatsCollector() throws Exception {
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.marvel.agent.collector.indices;
|
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.RecoveryResponse;
|
||||||
import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse;
|
import org.elasticsearch.action.admin.indices.recovery.ShardRecoveryResponse;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
|
@ -17,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoverySettings;
|
||||||
import org.elasticsearch.indices.recovery.RecoveryState;
|
import org.elasticsearch.indices.recovery.RecoveryState;
|
||||||
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
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.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@Slow
|
@ESIntegTestCase.ClusterScope(numDataNodes = 0)
|
||||||
@ElasticsearchIntegrationTest.ClusterScope(numDataNodes = 0)
|
public class IndexRecoveryCollectorTests extends ESIntegTestCase {
|
||||||
public class IndexRecoveryCollectorTests extends ElasticsearchIntegrationTest {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
||||||
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -22,7 +22,7 @@ import java.util.Iterator;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class IndexStatsCollectorTests extends ElasticsearchSingleNodeTest {
|
public class IndexStatsCollectorTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIndexStatsCollectorNoIndices() throws Exception {
|
public void testIndexStatsCollectorNoIndices() throws Exception {
|
||||||
|
|
|
@ -15,14 +15,14 @@ import org.elasticsearch.discovery.DiscoveryService;
|
||||||
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
import org.elasticsearch.marvel.agent.exporter.MarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
import org.elasticsearch.marvel.agent.settings.MarvelSettingsService;
|
||||||
import org.elasticsearch.node.service.NodeService;
|
import org.elasticsearch.node.service.NodeService;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class NodeStatsCollectorTests extends ElasticsearchIntegrationTest {
|
public class NodeStatsCollectorTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNodeStatsCollector() throws Exception {
|
public void testNodeStatsCollector() throws Exception {
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.elasticsearch.marvel.agent.exporter;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
|
||||||
import org.elasticsearch.action.admin.indices.stats.IndexStats;
|
import org.elasticsearch.action.admin.indices.stats.IndexStats;
|
||||||
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
|
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
|
||||||
import org.elasticsearch.common.Strings;
|
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.AgentService;
|
||||||
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Test;
|
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
|
// 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)
|
@ClusterScope(transportClientRatio = 0.0, scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0)
|
||||||
public class HttpESExporterTests extends ElasticsearchIntegrationTest {
|
public class HttpESExporterTests extends ESIntegTestCase {
|
||||||
|
|
||||||
final static AtomicLong timeStampGenerator = new AtomicLong();
|
final static AtomicLong timeStampGenerator = new AtomicLong();
|
||||||
|
|
||||||
|
@ -84,7 +83,6 @@ public class HttpESExporterTests extends ElasticsearchIntegrationTest {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@LuceneTestCase.Slow
|
|
||||||
public void testTemplateAdditionDespiteOfLateClusterForming() {
|
public void testTemplateAdditionDespiteOfLateClusterForming() {
|
||||||
Settings.Builder builder = Settings.builder()
|
Settings.Builder builder = Settings.builder()
|
||||||
.put(AgentService.SETTINGS_INTERVAL, "200m")
|
.put(AgentService.SETTINGS_INTERVAL, "200m")
|
||||||
|
|
|
@ -15,10 +15,10 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMarvelDoc;
|
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||||
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.junit.Test;
|
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";
|
private static final String SAMPLE_FILE = "/samples/marvel_cluster_state.json";
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,10 @@ import org.elasticsearch.common.io.Streams;
|
||||||
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMarvelDoc;
|
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||||
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.junit.Test;
|
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";
|
private static final String SAMPLE_FILE = "/samples/marvel_cluster_stats.json";
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.elasticsearch.indices.recovery.RecoveryState;
|
||||||
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMarvelDoc;
|
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -24,7 +24,7 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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";
|
private static final String SAMPLE_FILE = "/samples/marvel_index_recovery.json";
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,10 @@ import org.elasticsearch.index.store.StoreStats;
|
||||||
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMarvelDoc;
|
||||||
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
import org.elasticsearch.marvel.agent.renderer.Renderer;
|
||||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
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";
|
private static final String SAMPLE_FILE = "/samples/marvel_index_stats.json";
|
||||||
|
|
||||||
|
|
|
@ -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.Renderer;
|
||||||
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
import org.elasticsearch.marvel.agent.renderer.RendererTestUtils;
|
||||||
import org.elasticsearch.node.service.NodeService;
|
import org.elasticsearch.node.service.NodeService;
|
||||||
import org.elasticsearch.test.ElasticsearchSingleNodeTest;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
import org.junit.Test;
|
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";
|
private static final String SAMPLE_FILE = "/samples/marvel_node_stats.json";
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@ package org.elasticsearch.marvel.agent.settings;
|
||||||
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class MarvelSettingTests extends ElasticsearchTestCase {
|
public class MarvelSettingTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBooleanMarvelSetting() {
|
public void testBooleanMarvelSetting() {
|
||||||
|
|
|
@ -8,13 +8,13 @@ package org.elasticsearch.marvel.agent.settings;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class MarvelSettingsServiceTests extends ElasticsearchTestCase {
|
public class MarvelSettingsServiceTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMarvelSettingService() {
|
public void testMarvelSettingService() {
|
||||||
|
|
|
@ -19,19 +19,19 @@ import org.elasticsearch.license.plugin.core.LicensesService;
|
||||||
import org.elasticsearch.marvel.MarvelPlugin;
|
import org.elasticsearch.marvel.MarvelPlugin;
|
||||||
import org.elasticsearch.marvel.mode.Mode;
|
import org.elasticsearch.marvel.mode.Mode;
|
||||||
import org.elasticsearch.plugins.AbstractPlugin;
|
import org.elasticsearch.plugins.AbstractPlugin;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
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;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
@ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0)
|
@ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0)
|
||||||
public class LicenseIntegrationTests extends ElasticsearchIntegrationTest {
|
public class LicenseIntegrationTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
|
|
@ -10,14 +10,9 @@ import org.elasticsearch.common.metrics.MeanMetric;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.junit.Ignore;
|
|
||||||
|
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Ignore
|
|
||||||
public class HasherBenchmark {
|
public class HasherBenchmark {
|
||||||
|
|
||||||
private static final int WARMING_ITERS = 1000;
|
private static final int WARMING_ITERS = 1000;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
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.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.*;
|
||||||
/**
|
/**
|
||||||
* a helper class that contains a couple of HTTP helper methods
|
* 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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.client.ShieldClient;
|
import org.elasticsearch.shield.client.ShieldClient;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
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())));
|
private static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ import org.junit.Test;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST;
|
import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
|
||||||
|
|
||||||
@ClusterScope(scope = TEST)
|
@ClusterScope(scope = TEST)
|
||||||
public class ClusterPrivilegeTests extends AbstractPrivilegeTests {
|
public class ClusterPrivilegeTests extends AbstractPrivilegeTests {
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.plugins.AbstractPlugin;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
import org.elasticsearch.shield.license.LicenseService;
|
import org.elasticsearch.shield.license.LicenseService;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.junit.Test;
|
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 =
|
public static final String ROLES =
|
||||||
ShieldSettingsSource.DEFAULT_ROLE + ":\n" +
|
ShieldSettingsSource.DEFAULT_ROLE + ":\n" +
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
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.ShieldSettingsSource;
|
||||||
import org.junit.Test;
|
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.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
||||||
import static org.hamcrest.Matchers.is;
|
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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.List;
|
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,
|
* actions that are normally categorized as index actions as cluster actions - for example,
|
||||||
* index template actions.
|
* 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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.shield.crypto.CryptoService;
|
import org.elasticsearch.shield.crypto.CryptoService;
|
||||||
import org.elasticsearch.shield.crypto.InternalCryptoService;
|
import org.elasticsearch.shield.crypto.InternalCryptoService;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Locale;
|
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.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ScrollIdSigningTests extends ShieldIntegrationTest {
|
public class ScrollIdSigningTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSearchAndClearScroll() throws Exception {
|
public void testSearchAndClearScroll() throws Exception {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.client.Requests.searchRequest;
|
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.equalTo;
|
||||||
import static org.hamcrest.Matchers.is;
|
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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("passwd".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.ssl.AbstractSSLService;
|
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.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
||||||
|
@ -30,14 +30,14 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
|
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
|
||||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||||
import static org.hamcrest.CoreMatchers.nullValue;
|
import static org.hamcrest.CoreMatchers.nullValue;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
@ClusterScope(scope = SUITE)
|
@ClusterScope(scope = SUITE)
|
||||||
public class SettingsFilterTests extends ShieldIntegrationTest {
|
public class SettingsFilterTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
private CloseableHttpClient httpClient = HttpClients.createDefault();
|
private CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||||
import org.elasticsearch.index.query.QueryBuilders;
|
import org.elasticsearch.index.query.QueryBuilders;
|
||||||
import org.elasticsearch.script.ScriptService;
|
import org.elasticsearch.script.ScriptService;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
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.containsString;
|
||||||
import static org.hamcrest.Matchers.is;
|
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";
|
static final String READ_ONE_IDX_USER = "read_user";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.action.search.MultiSearchResponse;
|
||||||
import org.elasticsearch.action.search.SearchPhaseExecutionException;
|
import org.elasticsearch.action.search.SearchPhaseExecutionException;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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.containsString;
|
||||||
import static org.hamcrest.Matchers.is;
|
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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("change_me".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -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.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
|
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Ignore;
|
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
|
* 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.
|
* writes a group to role mapping file for each node.
|
||||||
*/
|
*/
|
||||||
@Ignore
|
abstract public class AbstractAdLdapRealmTestCase extends ShieldIntegTestCase {
|
||||||
@ElasticsearchIntegrationTest.Integration
|
|
||||||
abstract public class AbstractAdLdapRealmTests extends ShieldIntegrationTest {
|
|
||||||
|
|
||||||
public static final String SHIELD_AUTHC_REALMS_EXTERNAL = "shield.authc.realms.external";
|
public static final String SHIELD_AUTHC_REALMS_EXTERNAL = "shield.authc.realms.external";
|
||||||
public static final String PASSWORD = "NickFuryHeartsES";
|
public static final String PASSWORD = "NickFuryHeartsES";
|
|
@ -15,7 +15,7 @@ import java.io.IOException;
|
||||||
* The super class will provide appropriate group mappings via configGroupMappings()
|
* The super class will provide appropriate group mappings via configGroupMappings()
|
||||||
*/
|
*/
|
||||||
@Network
|
@Network
|
||||||
public class GroupMappingTests extends AbstractAdLdapRealmTests {
|
public class GroupMappingTests extends AbstractAdLdapRealmTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAuthcAuthz() throws IOException {
|
public void testAuthcAuthz() throws IOException {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||||
* This tests the mapping of multiple groups to a role
|
* This tests the mapping of multiple groups to a role
|
||||||
*/
|
*/
|
||||||
@Network
|
@Network
|
||||||
public class MultiGroupMappingTests extends AbstractAdLdapRealmTests {
|
public class MultiGroupMappingTests extends AbstractAdLdapRealmTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String configRoles() {
|
protected String configRoles() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.transport.ShieldServerTransportService;
|
import org.elasticsearch.shield.transport.ShieldServerTransportService;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
|
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.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
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;
|
private static boolean enabled;
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
package org.elasticsearch.shield;
|
package org.elasticsearch.shield;
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||||
import static org.hamcrest.Matchers.arrayContaining;
|
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_T1_SHIELD_ENABLED = "tribe.t1." + ShieldPlugin.ENABLED_SETTING_NAME;
|
||||||
private static final String TRIBE_T2_SHIELD_ENABLED = "tribe.t2." + ShieldPlugin.ENABLED_SETTING_NAME;
|
private static final String TRIBE_T2_SHIELD_ENABLED = "tribe.t2." + ShieldPlugin.ENABLED_SETTING_NAME;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
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.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
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.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ShieldPluginTests extends ShieldIntegrationTest {
|
public class ShieldPluginTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Settings nodeSettings(int nodeOrdinal) {
|
public Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield;
|
package org.elasticsearch.shield;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
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
|
@Test
|
||||||
public void testStrings() throws Exception {
|
public void testStrings() throws Exception {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
package org.elasticsearch.shield;
|
package org.elasticsearch.shield;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
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
|
* 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.
|
* helps keeping track of this and eventually making changes when needed.
|
||||||
*/
|
*/
|
||||||
public class VersionCompatibilityTests extends ElasticsearchTestCase {
|
public class VersionCompatibilityTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCompatibility() {
|
public void testCompatibility() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.shield.authz.AuthorizationService;
|
import org.elasticsearch.shield.authz.AuthorizationService;
|
||||||
import org.elasticsearch.shield.crypto.CryptoService;
|
import org.elasticsearch.shield.crypto.CryptoService;
|
||||||
import org.elasticsearch.shield.license.LicenseEventsNotifier;
|
import org.elasticsearch.shield.license.LicenseEventsNotifier;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 AuthenticationService authcService;
|
||||||
private AuthorizationService authzService;
|
private AuthorizationService authzService;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.elasticsearch.action.admin.indices.analyze.AnalyzeAction;
|
||||||
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
|
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
|
||||||
import org.elasticsearch.action.search.ClearScrollAction;
|
import org.elasticsearch.action.search.ClearScrollAction;
|
||||||
import org.elasticsearch.action.search.ClearScrollRequest;
|
import org.elasticsearch.action.search.ClearScrollRequest;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.KnownActionsTests;
|
import org.elasticsearch.transport.KnownActionsTests;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
|
||||||
public class ShieldActionMapperTests extends ElasticsearchTestCase {
|
public class ShieldActionMapperTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatAllOrdinaryActionsRemainTheSame() {
|
public void testThatAllOrdinaryActionsRemainTheSame() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.common.inject.Injector;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.settings.SettingsModule;
|
import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
|
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
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
|
@Test
|
||||||
public void testEnabled() throws Exception {
|
public void testEnabled() throws Exception {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationToken;
|
import org.elasticsearch.shield.authc.AuthenticationToken;
|
||||||
import org.elasticsearch.shield.transport.filter.IPFilter;
|
import org.elasticsearch.shield.transport.filter.IPFilter;
|
||||||
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
|
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 Set<AuditTrail> auditTrails;
|
||||||
private AuditTrailService service;
|
private AuditTrailService service;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.audit.index;
|
package org.elasticsearch.shield.audit.index;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
@ -13,7 +13,7 @@ import java.util.Locale;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class IndexAuditLevelTests extends ElasticsearchTestCase {
|
public class IndexAuditLevelTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllIndexAuditLevel() {
|
public void testAllIndexAuditLevel() {
|
||||||
|
|
|
@ -10,9 +10,9 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResp
|
||||||
import org.elasticsearch.action.exists.ExistsResponse;
|
import org.elasticsearch.action.exists.ExistsResponse;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
|
import org.elasticsearch.shield.audit.logfile.LoggingAuditTrail;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
|
import org.elasticsearch.test.ESIntegTestCase.Scope;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.joda.time.DateTimeZone;
|
import org.joda.time.DateTimeZone;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -20,7 +20,7 @@ import org.junit.Test;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@ClusterScope(scope = Scope.TEST, randomDynamicTemplates = false)
|
@ClusterScope(scope = Scope.TEST, randomDynamicTemplates = false)
|
||||||
public class IndexAuditTrailEnabledTests extends ShieldIntegrationTest {
|
public class IndexAuditTrailEnabledTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
IndexNameResolver.Rollover rollover = randomFrom(IndexNameResolver.Rollover.values());
|
IndexNameResolver.Rollover rollover = randomFrom(IndexNameResolver.Rollover.values());
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationToken;
|
import org.elasticsearch.shield.authc.AuthenticationToken;
|
||||||
import org.elasticsearch.shield.transport.filter.IPFilter;
|
import org.elasticsearch.shield.transport.filter.IPFilter;
|
||||||
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
|
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.InternalTestCluster;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.elasticsearch.transport.TransportInfo;
|
import org.elasticsearch.transport.TransportInfo;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
|
@ -49,7 +49,7 @@ import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.*;
|
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.elasticsearch.test.InternalTestCluster.clusterName;
|
||||||
import static org.hamcrest.Matchers.contains;
|
import static org.hamcrest.Matchers.contains;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
@ -61,8 +61,8 @@ import static org.mockito.Mockito.*;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ElasticsearchIntegrationTest.ClusterScope(scope = SUITE, numDataNodes = 1)
|
@ESIntegTestCase.ClusterScope(scope = SUITE, numDataNodes = 1)
|
||||||
public class IndexAuditTrailTests extends ShieldIntegrationTest {
|
public class IndexAuditTrailTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX;
|
public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.test.InternalTestCluster;
|
import org.elasticsearch.test.InternalTestCluster;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
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
|
* 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;
|
public static final String SECOND_CLUSTER_NODE_PREFIX = "remote_" + SUITE_CLUSTER_NODE_PREFIX;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.elasticsearch.shield.authc.AuthenticationToken;
|
||||||
import org.elasticsearch.shield.rest.RemoteHostHeader;
|
import org.elasticsearch.shield.rest.RemoteHostHeader;
|
||||||
import org.elasticsearch.shield.transport.filter.IPFilter;
|
import org.elasticsearch.shield.transport.filter.IPFilter;
|
||||||
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
|
import org.elasticsearch.shield.transport.filter.ShieldIpFilterRule;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 {
|
private static enum RestContent {
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,14 @@ import org.elasticsearch.common.io.stream.ByteBufferStreamInput;
|
||||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class AnonymousUserHolderTests extends ElasticsearchTestCase {
|
public class AnonymousUserHolderTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResolveAnonymousUser() throws Exception {
|
public void testResolveAnonymousUser() throws Exception {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -24,7 +24,7 @@ import java.util.Locale;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class AnonymousUserTests extends ShieldIntegrationTest {
|
public class AnonymousUserTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
private boolean authorizationExceptionsEnabled = randomBoolean();
|
private boolean authorizationExceptionsEnabled = randomBoolean();
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.elasticsearch.shield.audit.AuditTrail;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.crypto.CryptoService;
|
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.test.rest.FakeRestRequest;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -39,7 +39,7 @@ import static org.mockito.Mockito.*;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InternalAuthenticationServiceTests extends ElasticsearchTestCase {
|
public class InternalAuthenticationServiceTests extends ESTestCase {
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public ExpectedException thrown = ExpectedException.none();
|
public ExpectedException thrown = ExpectedException.none();
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.elasticsearch.rest.RestRequest;
|
||||||
import org.elasticsearch.shield.ShieldSettingsFilter;
|
import org.elasticsearch.shield.ShieldSettingsFilter;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
|
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 Map<String, Realm.Factory> factories;
|
||||||
private ShieldSettingsFilter settingsFilter;
|
private ShieldSettingsFilter settingsFilter;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
import org.elasticsearch.shield.ssl.ClientSSLService;
|
||||||
import org.elasticsearch.shield.support.NoOpLogger;
|
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.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -30,7 +30,7 @@ import java.util.regex.Pattern;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@Network
|
@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";
|
public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
private LDAPConnection ldapConnection;
|
private LDAPConnection ldapConnection;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.support.*;
|
import org.elasticsearch.shield.authc.support.*;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
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
|
* 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
|
* 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";
|
private static final String PASSWORD = "password";
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.ldap.LdapSessionFactory;
|
import org.elasticsearch.shield.authc.ldap.LdapSessionFactory;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
|
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.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
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.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -29,7 +29,7 @@ import static org.elasticsearch.test.ShieldTestsUtils.assertAuthenticationExcept
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@Network
|
@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 AD_LDAP_URL = "ldaps://54.213.145.20:636";
|
||||||
public static final String PASSWORD = "NickFuryHeartsES";
|
public static final String PASSWORD = "NickFuryHeartsES";
|
||||||
|
@ -231,7 +231,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
|
||||||
public void testStandardLdapConnection() throws Exception {
|
public void testStandardLdapConnection() throws Exception {
|
||||||
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
String userTemplate = "CN={0},CN=Users,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);
|
RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings);
|
||||||
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
|
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ public class ActiveDirectorySessionFactoryTests extends ElasticsearchTestCase {
|
||||||
@Test @SuppressWarnings("unchecked")
|
@Test @SuppressWarnings("unchecked")
|
||||||
public void testStandardLdapWithAttributeGroups() throws Exception {
|
public void testStandardLdapWithAttributeGroups() throws Exception {
|
||||||
String userTemplate = "CN={0},CN=Users,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, false);
|
Settings settings = LdapTestCase.buildLdapSettings(AD_LDAP_URL, userTemplate, false);
|
||||||
RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings);
|
RealmConfig config = new RealmConfig("ad-as-ldap-test", settings, globalSettings);
|
||||||
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
|
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 groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
String userTemplate = "CN={0},CN=Users,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()
|
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)
|
.put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true)
|
||||||
.build();
|
.build();
|
||||||
RealmConfig config = new RealmConfig("ad-test", settings, globalSettings);
|
RealmConfig config = new RealmConfig("ad-test", settings, globalSettings);
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
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.transport.TransportRequest;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.hamcrest.Matchers;
|
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 RestController restController;
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.RefreshListener;
|
import org.elasticsearch.shield.authc.support.RefreshListener;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
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.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
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 Settings settings;
|
||||||
private Environment env;
|
private Environment env;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.shield.audit.logfile.CapturingLogger;
|
import org.elasticsearch.shield.audit.logfile.CapturingLogger;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.support.RefreshListener;
|
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.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
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 Settings settings;
|
||||||
private Environment env;
|
private Environment env;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.rest.RestController;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
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.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.authc.support.DnRoleMapper;
|
import org.elasticsearch.shield.authc.support.DnRoleMapper;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
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.Matchers.anyString;
|
||||||
import static org.mockito.Mockito.*;
|
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_USER_TEMPLATE = "cn={0},ou=people,o=sevenSeas";
|
||||||
public static final String VALID_USERNAME = "Thomas Masterman Hardy";
|
public static final String VALID_USERNAME = "Thomas Masterman Hardy";
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
|
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.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class LdapSessionFactoryTests extends LdapTest {
|
public class LdapSessionFactoryTests extends LdapTestCase {
|
||||||
|
|
||||||
private Settings globalSettings;
|
private Settings globalSettings;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFactoryTests;
|
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFactoryTests;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
|
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.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
import org.elasticsearch.shield.ssl.ClientSSLService;
|
||||||
|
@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.*;
|
||||||
@ThreadLeakFilters(filters = {
|
@ThreadLeakFilters(filters = {
|
||||||
LdapUserSearchSessionFactoryTests.BackgroundConnectThreadLeakFilter.class
|
LdapUserSearchSessionFactoryTests.BackgroundConnectThreadLeakFilter.class
|
||||||
})
|
})
|
||||||
public class LdapUserSearchSessionFactoryTests extends LdapTest {
|
public class LdapUserSearchSessionFactoryTests extends LdapTestCase {
|
||||||
|
|
||||||
private ClientSSLService clientSSLService;
|
private ClientSSLService clientSSLService;
|
||||||
private Settings globalSettings;
|
private Settings globalSettings;
|
||||||
|
@ -260,7 +260,7 @@ public class LdapUserSearchSessionFactoryTests extends LdapTest {
|
||||||
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
String groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
Settings settings = settingsBuilder()
|
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("user_search.base_dn", userSearchBase)
|
||||||
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
|
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
|
||||||
.put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD)
|
.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 groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
||||||
String userSearchBase = "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()
|
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("user_search.base_dn", userSearchBase)
|
||||||
.put("bind_dn", "uid=blackwidow,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com")
|
.put("bind_dn", "uid=blackwidow,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com")
|
||||||
.put("bind_password", OpenLdapTests.PASSWORD)
|
.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 groupSearchBase = "DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
String userSearchBase = "CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
Settings ldapSettings = settingsBuilder()
|
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("user_search.base_dn", userSearchBase)
|
||||||
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
|
.put("bind_dn", "ironman@ad.test.elasticsearch.com")
|
||||||
.put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD)
|
.put("bind_password", ActiveDirectorySessionFactoryTests.PASSWORD)
|
||||||
|
|
|
@ -11,11 +11,11 @@ import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.LdapSession;
|
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.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
import org.elasticsearch.shield.authc.support.SecuredStringTests;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
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.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.hasItem;
|
import static org.hamcrest.Matchers.hasItem;
|
||||||
|
|
||||||
@Network
|
@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 OPEN_LDAP_URL = "ldaps://54.200.235.244:636";
|
||||||
public static final String PASSWORD = "NickFuryHeartsES";
|
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
|
//openldap does not use cn as naming attributes by default
|
||||||
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
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";
|
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);
|
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
|
||||||
|
|
||||||
String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" };
|
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 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";
|
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);
|
LdapSessionFactory sessionFactory = new LdapSessionFactory(config, clientSSLService);
|
||||||
|
|
||||||
String[] users = new String[] { "blackwidow", "cap", "hawkeye", "hulk", "ironman", "thor" };
|
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 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";
|
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
||||||
Settings settings = Settings.builder()
|
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.filter", "(&(objectclass=posixGroup)(memberUID={0}))")
|
||||||
.put("group_search.user_attribute", "uid")
|
.put("group_search.user_attribute", "uid")
|
||||||
.build();
|
.build();
|
||||||
|
@ -108,7 +108,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
|
||||||
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
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";
|
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
||||||
Settings settings = Settings.builder()
|
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.HOSTNAME_VERIFICATION_SETTING, false)
|
||||||
.put(SessionFactory.TIMEOUT_TCP_READ_SETTING, "1ms") //1 millisecond
|
.put(SessionFactory.TIMEOUT_TCP_READ_SETTING, "1ms") //1 millisecond
|
||||||
.build();
|
.build();
|
||||||
|
@ -130,7 +130,7 @@ public class OpenLdapTests extends ElasticsearchTestCase {
|
||||||
String groupSearchBase = "ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
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";
|
String userTemplate = "uid={0},ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
||||||
Settings settings = Settings.builder()
|
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)
|
.put(LdapSessionFactory.HOSTNAME_VERIFICATION_SETTING, true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.ldap.support.LdapSearchScope;
|
||||||
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
import org.elasticsearch.shield.ssl.ClientSSLService;
|
||||||
import org.elasticsearch.shield.support.NoOpLogger;
|
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.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@Network
|
@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";
|
public static final String BRUCE_BANNER_DN = "uid=hulk,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com";
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.elasticsearch.shield.authc.activedirectory.ActiveDirectorySessionFact
|
||||||
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
import org.elasticsearch.shield.authc.ldap.support.SessionFactory;
|
||||||
import org.elasticsearch.shield.ssl.ClientSSLService;
|
import org.elasticsearch.shield.ssl.ClientSSLService;
|
||||||
import org.elasticsearch.shield.support.NoOpLogger;
|
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.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -28,7 +28,7 @@ import java.util.List;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
@Network
|
@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";
|
public static final String BRUCE_BANNER_DN = "cn=Bruce Banner,CN=Users,DC=ad,DC=test,DC=elasticsearch,DC=com";
|
||||||
private LDAPConnection ldapConnection;
|
private LDAPConnection ldapConnection;
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.authc.ldap.support;
|
package org.elasticsearch.shield.authc.ldap.support;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class LDAPServersTests extends ElasticsearchTestCase {
|
public class LDAPServersTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConfigure_1ldaps() {
|
public void testConfigure_1ldaps() {
|
||||||
|
|
|
@ -13,16 +13,16 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.ldap.LdapRealm;
|
import org.elasticsearch.shield.authc.ldap.LdapRealm;
|
||||||
import org.elasticsearch.shield.authc.support.DnRoleMapper;
|
import org.elasticsearch.shield.authc.support.DnRoleMapper;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
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 LdapTestCase extends ESTestCase {
|
||||||
public abstract class LdapTest extends ElasticsearchTestCase {
|
|
||||||
|
|
||||||
protected InMemoryDirectoryServer ldapServer;
|
protected InMemoryDirectoryServer ldapServer;
|
||||||
|
|
|
@ -11,13 +11,13 @@ import com.unboundid.util.ssl.TrustAllSSLSocketVerifier;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class SessionFactoryTests extends ElasticsearchTestCase {
|
public class SessionFactoryTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void connectionFactoryReturnsCorrectLDAPConnectionOptionsWithDefaultSettings() {
|
public void connectionFactoryReturnsCorrectLDAPConnectionOptionsWithDefaultSettings() {
|
||||||
|
|
|
@ -20,8 +20,8 @@ import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.shield.transport.SSLClientAuth;
|
import org.elasticsearch.shield.transport.SSLClientAuth;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.*;
|
||||||
* Test authentication via PKI on both REST and Transport layers
|
* Test authentication via PKI on both REST and Transport layers
|
||||||
*/
|
*/
|
||||||
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
||||||
public class PkiAuthenticationTests extends ShieldIntegrationTest {
|
public class PkiAuthenticationTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
|
|
@ -11,14 +11,13 @@ import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.license.plugin.LicensePlugin;
|
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.shield.ShieldPlugin;
|
import org.elasticsearch.shield.ShieldPlugin;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.transport.SSLClientAuth;
|
import org.elasticsearch.shield.transport.SSLClientAuth;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
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.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
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.elasticsearch.test.ShieldSettingsSource.DEFAULT_USER_NAME;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
public class PkiOptionalClientAuthTests extends ShieldIntegrationTest {
|
public class PkiOptionalClientAuthTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
private static int randomClientPort;
|
private static int randomClientPort;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.shield.authc.support.DnRoleMapper;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.support.NoOpLogger;
|
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.test.rest.FakeRestRequest;
|
||||||
import org.elasticsearch.transport.TransportMessage;
|
import org.elasticsearch.transport.TransportMessage;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -31,7 +31,7 @@ import java.util.regex.Pattern;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class PkiRealmTests extends ElasticsearchTestCase {
|
public class PkiRealmTests extends ESTestCase {
|
||||||
|
|
||||||
private Settings globalSettings;
|
private Settings globalSettings;
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.shield.transport.SSLClientAuth;
|
import org.elasticsearch.shield.transport.SSLClientAuth;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransport;
|
||||||
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
|
import org.elasticsearch.shield.transport.netty.ShieldNettyTransport;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
||||||
|
@ -35,7 +35,7 @@ import java.util.Locale;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
||||||
public class PkiWithoutClientAuthenticationTests extends ShieldIntegrationTest {
|
public class PkiWithoutClientAuthenticationTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
private TrustManager[] trustAllCerts = new TrustManager[] {
|
private TrustManager[] trustAllCerts = new TrustManager[] {
|
||||||
new X509TrustManager() {
|
new X509TrustManager() {
|
||||||
|
|
|
@ -13,8 +13,8 @@ import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
import org.elasticsearch.shield.authc.support.UsernamePasswordToken;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
import org.elasticsearch.test.rest.client.http.HttpRequestBuilder;
|
||||||
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
import org.elasticsearch.test.rest.client.http.HttpResponse;
|
||||||
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
@ClusterScope(numClientNodes = 0, numDataNodes = 1)
|
||||||
public class PkiWithoutSSLTests extends ShieldIntegrationTest {
|
public class PkiWithoutSSLTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean sslTransportEnabled() {
|
public boolean sslTransportEnabled() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.Realm;
|
import org.elasticsearch.shield.authc.Realm;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class CachingUsernamePasswordRealmTests extends ElasticsearchTestCase {
|
public class CachingUsernamePasswordRealmTests extends ESTestCase {
|
||||||
|
|
||||||
private Settings globalSettings;
|
private Settings globalSettings;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger;
|
||||||
import org.elasticsearch.shield.authc.RealmConfig;
|
import org.elasticsearch.shield.authc.RealmConfig;
|
||||||
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectoryRealm;
|
import org.elasticsearch.shield.authc.activedirectory.ActiveDirectoryRealm;
|
||||||
import org.elasticsearch.shield.authc.ldap.LdapRealm;
|
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.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
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[] {
|
private static final String[] STARK_GROUP_DNS = new String[] {
|
||||||
//groups can be named by different attributes, depending on the directory,
|
//groups can be named by different attributes, depending on the directory,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.authc.support;
|
package org.elasticsearch.shield.authc.support;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.sameInstance;
|
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
|
@Test
|
||||||
public void testBcryptFamily_SelfGenerated() throws Exception {
|
public void testBcryptFamily_SelfGenerated() throws Exception {
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.authc.support;
|
package org.elasticsearch.shield.authc.support;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class SecuredStringTests extends ElasticsearchTestCase {
|
public class SecuredStringTests extends ESTestCase {
|
||||||
public static SecuredString build(String password){
|
public static SecuredString build(String password){
|
||||||
return new SecuredString(password.toCharArray());
|
return new SecuredString(password.toCharArray());
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
|
||||||
import org.elasticsearch.ElasticsearchSecurityException;
|
import org.elasticsearch.ElasticsearchSecurityException;
|
||||||
import org.elasticsearch.common.Base64;
|
import org.elasticsearch.common.Base64;
|
||||||
import org.elasticsearch.rest.RestRequest;
|
import org.elasticsearch.rest.RestRequest;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportRequest;
|
import org.elasticsearch.transport.TransportRequest;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
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
|
@Rule
|
||||||
public ExpectedException thrown = ExpectedException.none();
|
public ExpectedException thrown = ExpectedException.none();
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz;
|
||||||
import org.elasticsearch.ElasticsearchSecurityException;
|
import org.elasticsearch.ElasticsearchSecurityException;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER;
|
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.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException;
|
||||||
import static org.hamcrest.CoreMatchers.containsString;
|
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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.action.support.IndicesOptions;
|
||||||
import org.elasticsearch.index.IndexNotFoundException;
|
import org.elasticsearch.index.IndexNotFoundException;
|
||||||
import org.elasticsearch.shield.authc.support.Hasher;
|
import org.elasticsearch.shield.authc.support.Hasher;
|
||||||
import org.elasticsearch.shield.authc.support.SecuredString;
|
import org.elasticsearch.shield.authc.support.SecuredString;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
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())));
|
protected static final String USERS_PASSWD_HASHED = new String(Hasher.BCRYPT.hash(new SecuredString("test123".toCharArray())));
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.audit.AuditTrail;
|
import org.elasticsearch.shield.audit.AuditTrail;
|
||||||
import org.elasticsearch.shield.authc.AnonymousService;
|
import org.elasticsearch.shield.authc.AnonymousService;
|
||||||
import org.elasticsearch.shield.authz.store.RolesStore;
|
import org.elasticsearch.shield.authz.store.RolesStore;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportRequest;
|
import org.elasticsearch.transport.TransportRequest;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.contains;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
public class InternalAuthorizationServiceTests extends ElasticsearchTestCase {
|
public class InternalAuthorizationServiceTests extends ESTestCase {
|
||||||
|
|
||||||
private AuditTrail auditTrail;
|
private AuditTrail auditTrail;
|
||||||
private RolesStore rolesStore;
|
private RolesStore rolesStore;
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.shield.authz;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import org.elasticsearch.action.get.GetAction;
|
import org.elasticsearch.action.get.GetAction;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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;
|
private Permission.Global.Role permission;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.action.search.SearchAction;
|
||||||
import org.elasticsearch.action.suggest.SuggestAction;
|
import org.elasticsearch.action.suggest.SuggestAction;
|
||||||
import org.elasticsearch.shield.support.AutomatonPredicate;
|
import org.elasticsearch.shield.support.AutomatonPredicate;
|
||||||
import org.elasticsearch.shield.support.Automatons;
|
import org.elasticsearch.shield.support.Automatons;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
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
|
@Rule
|
||||||
public ExpectedException thrown = ExpectedException.none();
|
public ExpectedException thrown = ExpectedException.none();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.authz;
|
package org.elasticsearch.shield.authz;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.is;
|
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
|
@Test
|
||||||
public void testCheck() throws Exception {
|
public void testCheck() throws Exception {
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.index.IndexNotFoundException;
|
import org.elasticsearch.index.IndexNotFoundException;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authz.AuthorizationService;
|
import org.elasticsearch.shield.authz.AuthorizationService;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.*;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class DefaultIndicesResolverTests extends ElasticsearchTestCase {
|
public class DefaultIndicesResolverTests extends ESTestCase {
|
||||||
|
|
||||||
private User user;
|
private User user;
|
||||||
private User userNoIndices;
|
private User userNoIndices;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.action.support.IndicesOptions;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.index.IndexNotFoundException;
|
import org.elasticsearch.index.IndexNotFoundException;
|
||||||
import org.elasticsearch.search.SearchHit;
|
import org.elasticsearch.search.SearchHit;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import java.util.List;
|
||||||
import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException;
|
import static org.elasticsearch.test.ShieldTestsUtils.assertAuthorizationException;
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
|
|
||||||
public class IndicesResolverIntegrationTests extends ShieldIntegrationTest {
|
public class IndicesResolverIntegrationTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String configRoles() {
|
protected String configRoles() {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.shield.audit.logfile.CapturingLogger;
|
||||||
import org.elasticsearch.shield.authc.support.RefreshListener;
|
import org.elasticsearch.shield.authc.support.RefreshListener;
|
||||||
import org.elasticsearch.shield.authz.Permission;
|
import org.elasticsearch.shield.authz.Permission;
|
||||||
import org.elasticsearch.shield.authz.Privilege;
|
import org.elasticsearch.shield.authz.Privilege;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.*;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FileRolesStoreTests extends ElasticsearchTestCase {
|
public class FileRolesStoreTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testParseFile() throws Exception {
|
public void testParseFile() throws Exception {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
|
||||||
import org.elasticsearch.common.io.Streams;
|
import org.elasticsearch.common.io.Streams;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
import org.junit.After;
|
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 ResourceWatcherService watcherService;
|
||||||
private Settings settings;
|
private Settings settings;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.rest.RestFilterChain;
|
||||||
import org.elasticsearch.rest.RestRequest;
|
import org.elasticsearch.rest.RestRequest;
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationService;
|
import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 AuthenticationService authcService;
|
||||||
private RestChannel channel;
|
private RestChannel channel;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.test.junit.annotations.Network;
|
import org.elasticsearch.test.junit.annotations.Network;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
||||||
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ClientSSLServiceTests extends ElasticsearchTestCase {
|
public class ClientSSLServiceTests extends ESTestCase {
|
||||||
|
|
||||||
Environment env;
|
Environment env;
|
||||||
Path testclientStore;
|
Path testclientStore;
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.elasticsearch.shield.ssl;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.shield.ssl.AbstractSSLService.SSLSettings;
|
import org.elasticsearch.shield.ssl.AbstractSSLService.SSLSettings;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import javax.net.ssl.KeyManagerFactory;
|
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.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class SSLSettingsTests extends ElasticsearchTestCase {
|
public class SSLSettingsTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatSSLSettingsWithEmptySettingsHaveCorrectDefaults() {
|
public void testThatSSLSettingsWithEmptySettingsHaveCorrectDefaults() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.shield.ShieldSettingsFilter;
|
import org.elasticsearch.shield.ShieldSettingsFilter;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
public class ServerSSLServiceTests extends ElasticsearchTestCase {
|
public class ServerSSLServiceTests extends ESTestCase {
|
||||||
|
|
||||||
Path testnodeStore;
|
Path testnodeStore;
|
||||||
ShieldSettingsFilter settingsFilter;
|
ShieldSettingsFilter settingsFilter;
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.elasticsearch.shield.support;
|
||||||
|
|
||||||
import dk.brics.automaton.Automaton;
|
import dk.brics.automaton.Automaton;
|
||||||
import dk.brics.automaton.RunAutomaton;
|
import dk.brics.automaton.RunAutomaton;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.elasticsearch.shield.support.Automatons.*;
|
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
|
@Test
|
||||||
public void testPatterns_UnionOfMultiplePatterns() throws Exception {
|
public void testPatterns_UnionOfMultiplePatterns() throws Exception {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import com.google.common.base.Charsets;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.common.jimfs.Configuration;
|
import com.google.common.jimfs.Configuration;
|
||||||
import com.google.common.jimfs.Jimfs;
|
import com.google.common.jimfs.Jimfs;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
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.elasticsearch.shield.support.ShieldFiles.openAtomicMoveWriter;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
public class ShieldFilesTests extends ElasticsearchTestCase {
|
public class ShieldFilesTests extends ESTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testThatOriginalPermissionsAreKept() throws Exception {
|
public void testThatOriginalPermissionsAreKept() throws Exception {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.shield.support;
|
package org.elasticsearch.shield.support;
|
||||||
|
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
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 = {
|
private static final char[] alphabet = {
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.elasticsearch.shield.transport;
|
||||||
|
|
||||||
import org.elasticsearch.shield.User;
|
import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationService;
|
import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
import org.elasticsearch.test.ESTestCase;
|
||||||
import org.elasticsearch.transport.TransportRequest;
|
import org.elasticsearch.transport.TransportRequest;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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 AuthenticationService authcService;
|
||||||
private ClientTransportFilter filter;
|
private ClientTransportFilter filter;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.shield.ShieldPlugin;
|
import org.elasticsearch.shield.ShieldPlugin;
|
||||||
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
|
import org.elasticsearch.shield.authc.esusers.ESUsersRealm;
|
||||||
import org.elasticsearch.shield.crypto.InternalCryptoService;
|
import org.elasticsearch.shield.crypto.InternalCryptoService;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.test.ShieldSettingsSource;
|
import org.elasticsearch.test.ShieldSettingsSource;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.junit.BeforeClass;
|
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.instanceOf;
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
|
|
||||||
public class ServerTransportFilterIntegrationTests extends ShieldIntegrationTest {
|
public class ServerTransportFilterIntegrationTests extends ShieldIntegTestCase {
|
||||||
|
|
||||||
private static int randomClientPort;
|
private static int randomClientPort;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.elasticsearch.shield.User;
|
||||||
import org.elasticsearch.shield.action.ShieldActionMapper;
|
import org.elasticsearch.shield.action.ShieldActionMapper;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationService;
|
import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.shield.authz.AuthorizationService;
|
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.TransportRequest;
|
||||||
import org.elasticsearch.transport.netty.NettyTransport;
|
import org.elasticsearch.transport.netty.NettyTransport;
|
||||||
import org.elasticsearch.transport.netty.NettyTransportChannel;
|
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 AuthenticationService authcService;
|
||||||
private AuthorizationService authzService;
|
private AuthorizationService authzService;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.elasticsearch.plugins.AbstractPlugin;
|
||||||
import org.elasticsearch.shield.action.ShieldActionMapper;
|
import org.elasticsearch.shield.action.ShieldActionMapper;
|
||||||
import org.elasticsearch.shield.authc.AuthenticationService;
|
import org.elasticsearch.shield.authc.AuthenticationService;
|
||||||
import org.elasticsearch.shield.authz.AuthorizationService;
|
import org.elasticsearch.shield.authz.AuthorizationService;
|
||||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
import org.elasticsearch.test.ESIntegTestCase;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.*;
|
import org.elasticsearch.transport.*;
|
||||||
import org.elasticsearch.transport.netty.NettyTransport;
|
import org.elasticsearch.transport.netty.NettyTransport;
|
||||||
|
@ -33,8 +33,8 @@ import java.util.Map;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.SUITE;
|
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.mockito.Matchers.isA;
|
import static org.mockito.Matchers.isA;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
|
@ -43,7 +43,7 @@ import static org.mockito.Mockito.*;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ClusterScope(scope = SUITE, numDataNodes = 0)
|
@ClusterScope(scope = SUITE, numDataNodes = 0)
|
||||||
public class TransportFilterTests extends ElasticsearchIntegrationTest {
|
public class TransportFilterTests extends ESIntegTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Settings nodeSettings(int nodeOrdinal) {
|
protected Settings nodeSettings(int nodeOrdinal) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.node.settings.NodeSettingsService;
|
import org.elasticsearch.node.settings.NodeSettingsService;
|
||||||
import org.elasticsearch.shield.audit.AuditTrail;
|
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.test.junit.annotations.Network;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.junit.Before;
|
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 IPFilter ipFilter;
|
||||||
private AuditTrail auditTrail;
|
private AuditTrail auditTrail;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
import org.elasticsearch.http.HttpServerTransport;
|
import org.elasticsearch.http.HttpServerTransport;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.test.ShieldIntegrationTest;
|
import org.elasticsearch.test.ShieldIntegTestCase;
|
||||||
import org.elasticsearch.transport.Transport;
|
import org.elasticsearch.transport.Transport;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -22,14 +22,14 @@ import java.io.OutputStream;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
|
import static org.elasticsearch.test.ESIntegTestCase.ClusterScope;
|
||||||
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope;
|
import static org.elasticsearch.test.ESIntegTestCase.Scope;
|
||||||
import static org.hamcrest.Matchers.instanceOf;
|
import static org.hamcrest.Matchers.instanceOf;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
// no client nodes, no transport clients, as they all get rejected on network connections
|
// 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)
|
@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;
|
private static int randomClientPort;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue