diff --git a/server/src/test/java/org/elasticsearch/action/ActionListenerTests.java b/server/src/test/java/org/opensearch/action/ActionListenerTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/action/ActionListenerTests.java rename to server/src/test/java/org/opensearch/action/ActionListenerTests.java index 96ea6134a7a87..4e314e36244df 100644 --- a/server/src/test/java/org/elasticsearch/action/ActionListenerTests.java +++ b/server/src/test/java/org/opensearch/action/ActionListenerTests.java @@ -16,13 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.common.CheckedConsumer; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.CheckedConsumer; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.ActionListener; + import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -34,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -public class ActionListenerTests extends ESTestCase { +public class ActionListenerTests extends OpenSearchTestCase { public void testWrap() { AtomicReference reference = new AtomicReference<>(); diff --git a/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java b/server/src/test/java/org/opensearch/action/ActionModuleTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/ActionModuleTests.java rename to server/src/test/java/org/opensearch/action/ActionModuleTests.java index 575eac47eb96b..fb73f561f6aa0 100644 --- a/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java +++ b/server/src/test/java/org/opensearch/action/ActionModuleTests.java @@ -17,35 +17,36 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.action.main.MainAction; -import org.elasticsearch.action.main.TransportMainAction; +import org.opensearch.action.main.MainAction; +import org.opensearch.action.main.TransportMainAction; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.TransportAction; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.plugins.ActionPlugin; -import org.elasticsearch.plugins.ActionPlugin.ActionHandler; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.SettingsFilter; +import org.opensearch.common.settings.SettingsModule; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.plugins.ActionPlugin; +import org.opensearch.plugins.ActionPlugin.ActionHandler; + import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestController; import org.opensearch.rest.RestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestRequest.Method; import org.opensearch.rest.action.RestMainAction; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.usage.UsageService; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.usage.UsageService; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionModule; import org.opensearch.action.ActionRequest; @@ -62,7 +63,7 @@ import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.startsWith; -public class ActionModuleTests extends ESTestCase { +public class ActionModuleTests extends OpenSearchTestCase { public void testSetupActionsContainsKnownBuiltin() { assertThat(ActionModule.setupActions(emptyList()), hasEntry(MainAction.INSTANCE.name(), new ActionHandler<>(MainAction.INSTANCE, TransportMainAction.class))); diff --git a/server/src/test/java/org/elasticsearch/action/ActionTests.java b/server/src/test/java/org/opensearch/action/ActionTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/ActionTests.java rename to server/src/test/java/org/opensearch/action/ActionTests.java index 0dd960e695a66..b0881370a044d 100644 --- a/server/src/test/java/org/elasticsearch/action/ActionTests.java +++ b/server/src/test/java/org/opensearch/action/ActionTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.ActionResponse; import org.opensearch.action.ActionType; -public class ActionTests extends ESTestCase { +public class ActionTests extends OpenSearchTestCase { public void testEquals() { class FakeAction extends ActionType { diff --git a/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java b/server/src/test/java/org/opensearch/action/DocWriteResponseTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java rename to server/src/test/java/org/opensearch/action/DocWriteResponseTests.java index e63af3592b3b9..2ab104c2f34cf 100644 --- a/server/src/test/java/org/elasticsearch/action/DocWriteResponseTests.java +++ b/server/src/test/java/org/opensearch/action/DocWriteResponseTests.java @@ -17,19 +17,18 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.opensearch.action.DocWriteResponse; import org.opensearch.action.DocWriteResponse.Result; -import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.seqno.SequenceNumbers; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.support.replication.ReplicationResponse.ShardInfo; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.seqno.SequenceNumbers; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; @@ -37,7 +36,7 @@ import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.not; -public class DocWriteResponseTests extends ESTestCase { +public class DocWriteResponseTests extends OpenSearchTestCase { public void testGetLocation() { final DocWriteResponse response = new DocWriteResponse( diff --git a/server/src/test/java/org/elasticsearch/action/NotifyOnceListenerTests.java b/server/src/test/java/org/opensearch/action/NotifyOnceListenerTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/NotifyOnceListenerTests.java rename to server/src/test/java/org/opensearch/action/NotifyOnceListenerTests.java index 820d6e111a550..f74a961df29a3 100644 --- a/server/src/test/java/org/elasticsearch/action/NotifyOnceListenerTests.java +++ b/server/src/test/java/org/opensearch/action/NotifyOnceListenerTests.java @@ -17,14 +17,14 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.NotifyOnceListener; import java.util.concurrent.atomic.AtomicReference; -public class NotifyOnceListenerTests extends ESTestCase { +public class NotifyOnceListenerTests extends OpenSearchTestCase { public void testWhenSuccessCannotNotifyMultipleTimes() { AtomicReference response = new AtomicReference<>(); diff --git a/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java b/server/src/test/java/org/opensearch/action/OriginalIndicesTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java rename to server/src/test/java/org/opensearch/action/OriginalIndicesTests.java index 28ae1e231e3e2..25198b9a70822 100644 --- a/server/src/test/java/org/elasticsearch/action/OriginalIndicesTests.java +++ b/server/src/test/java/org/opensearch/action/OriginalIndicesTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.OriginalIndices; import java.io.IOException; -import static org.elasticsearch.test.VersionUtils.randomCompatibleVersion; +import static org.opensearch.test.VersionUtils.randomCompatibleVersion; import static org.hamcrest.CoreMatchers.equalTo; -public class OriginalIndicesTests extends ESTestCase { +public class OriginalIndicesTests extends OpenSearchTestCase { private static final IndicesOptions[] indicesOptionsValues = new IndicesOptions[]{ IndicesOptions.lenientExpandOpen() , IndicesOptions.strictExpand(), IndicesOptions.strictExpandOpen(), diff --git a/server/src/test/java/org/elasticsearch/action/RequestValidatorsTests.java b/server/src/test/java/org/opensearch/action/RequestValidatorsTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/RequestValidatorsTests.java rename to server/src/test/java/org/opensearch/action/RequestValidatorsTests.java index 56668af6642bf..963ba22032cc7 100644 --- a/server/src/test/java/org/elasticsearch/action/RequestValidatorsTests.java +++ b/server/src/test/java/org/opensearch/action/RequestValidatorsTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest; -import org.elasticsearch.common.Randomness; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.hamcrest.OptionalMatchers; +import org.opensearch.common.Randomness; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.hamcrest.OptionalMatchers; import org.hamcrest.Matchers; import org.opensearch.action.RequestValidators; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Optional; -public class RequestValidatorsTests extends ESTestCase { +public class RequestValidatorsTests extends OpenSearchTestCase { private final RequestValidators.RequestValidator EMPTY = (request, state, indices) -> Optional.empty(); private final RequestValidators.RequestValidator FAIL = diff --git a/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java b/server/src/test/java/org/opensearch/action/ShardOperationFailedExceptionTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java rename to server/src/test/java/org/opensearch/action/ShardOperationFailedExceptionTests.java index daaa152da1ec8..3915ab1ef8933 100644 --- a/server/src/test/java/org/elasticsearch/action/ShardOperationFailedExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/ShardOperationFailedExceptionTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; +import org.opensearch.common.Nullable; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.ShardOperationFailedException; import java.io.IOException; -public class ShardOperationFailedExceptionTests extends ESTestCase { +public class ShardOperationFailedExceptionTests extends OpenSearchTestCase { public void testCauseCannotBeNull() { NullPointerException nullPointerException = expectThrows(NullPointerException.class, () -> new Failure( diff --git a/server/src/test/java/org/elasticsearch/action/ShardValidateQueryRequestTests.java b/server/src/test/java/org/opensearch/action/ShardValidateQueryRequestTests.java similarity index 81% rename from server/src/test/java/org/elasticsearch/action/ShardValidateQueryRequestTests.java rename to server/src/test/java/org/opensearch/action/ShardValidateQueryRequestTests.java index a8dcc62b60294..6a480cdc6df64 100644 --- a/server/src/test/java/org/elasticsearch/action/ShardValidateQueryRequestTests.java +++ b/server/src/test/java/org/opensearch/action/ShardValidateQueryRequestTests.java @@ -16,28 +16,28 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; import org.opensearch.action.admin.indices.validate.query.ShardValidateQueryRequest; import org.opensearch.action.admin.indices.validate.query.ValidateQueryRequest; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.IndicesModule; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.IndicesModule; +import org.opensearch.search.SearchModule; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class ShardValidateQueryRequestTests extends ESTestCase { +public class ShardValidateQueryRequestTests extends OpenSearchTestCase { protected NamedWriteableRegistry namedWriteableRegistry; public void setUp() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/action/StepListenerTests.java b/server/src/test/java/org/opensearch/action/StepListenerTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/StepListenerTests.java rename to server/src/test/java/org/opensearch/action/StepListenerTests.java index 0cd26393a232c..83a033ff57de3 100644 --- a/server/src/test/java/org/elasticsearch/action/StepListenerTests.java +++ b/server/src/test/java/org/opensearch/action/StepListenerTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.RemoteTransportException; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.RemoteTransportException; import org.junit.After; import org.junit.Before; import org.opensearch.action.StepListener; @@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.equalTo; -public class StepListenerTests extends ESTestCase { +public class StepListenerTests extends OpenSearchTestCase { private ThreadPool threadPool; @Before diff --git a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java b/server/src/test/java/org/opensearch/action/TaskOperationFailureTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java rename to server/src/test/java/org/opensearch/action/TaskOperationFailureTests.java index fef923a81aec7..612a96bc296dc 100644 --- a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java +++ b/server/src/test/java/org/opensearch/action/TaskOperationFailureTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action; +package org.opensearch.action; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.TaskOperationFailure; import java.io.IOException; @@ -45,8 +45,8 @@ protected void assertEqualInstances(TaskOperationFailure expectedInstance, TaskO assertThat(newInstance.getNodeId(), equalTo(expectedInstance.getNodeId())); assertThat(newInstance.getTaskId(), equalTo(expectedInstance.getTaskId())); assertThat(newInstance.getStatus(), equalTo(expectedInstance.getStatus())); - // XContent loses the original exception and wraps it as a message in Elasticsearch exception - assertThat(newInstance.getCause().getMessage(), equalTo("Elasticsearch exception [type=illegal_state_exception, reason=message]")); + // XContent loses the original exception and wraps it as a message in OpenSearch exception + assertThat(newInstance.getCause().getMessage(), equalTo("OpenSearch exception [type=illegal_state_exception, reason=message]")); } @Override diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java index 9908df114ab18..480ba93961d17 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainActionTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.allocation; - -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.routing.RoutingNode; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.UnassignedInfo; -import org.elasticsearch.cluster.routing.allocation.AllocationDecision; -import org.elasticsearch.cluster.routing.allocation.AllocationService; -import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; -import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision; -import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator; -import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.gateway.TestGatewayAllocator; +package org.opensearch.action.admin.cluster.allocation; + +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.routing.RoutingNode; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.UnassignedInfo; +import org.opensearch.cluster.routing.allocation.AllocationDecision; +import org.opensearch.cluster.routing.allocation.AllocationService; +import org.opensearch.cluster.routing.allocation.RoutingAllocation; +import org.opensearch.cluster.routing.allocation.ShardAllocationDecision; +import org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator; +import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders; +import org.opensearch.common.Strings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.gateway.TestGatewayAllocator; import org.opensearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest; import org.opensearch.action.admin.cluster.allocation.ClusterAllocationExplanation; import org.opensearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction; @@ -50,7 +50,7 @@ /** * Tests for the {@link TransportClusterAllocationExplainAction} class. */ -public class ClusterAllocationExplainActionTests extends ESTestCase { +public class ClusterAllocationExplainActionTests extends OpenSearchTestCase { private static final AllocationDeciders NOOP_DECIDERS = new AllocationDeciders(Collections.emptyList()); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java index e85b26aab5a7b..f8467718092d7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.allocation; +package org.opensearch.action.admin.cluster.allocation; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.allocation.ClusterAllocationExplainRequest; -public class ClusterAllocationExplainRequestTests extends ESTestCase { +public class ClusterAllocationExplainRequestTests extends OpenSearchTestCase { public void testSerialization() throws Exception { ClusterAllocationExplainRequest request = diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java similarity index 80% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java index 9890159d6f46f..0f966d6500427 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanationTests.java @@ -17,28 +17,28 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.allocation; +package org.opensearch.action.admin.cluster.allocation; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.cluster.routing.UnassignedInfo; -import org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision; -import org.elasticsearch.cluster.routing.allocation.AllocationDecision; -import org.elasticsearch.cluster.routing.allocation.MoveDecision; -import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision; -import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.Version; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.cluster.routing.UnassignedInfo; +import org.opensearch.cluster.routing.allocation.AllocateUnassignedDecision; +import org.opensearch.cluster.routing.allocation.AllocationDecision; +import org.opensearch.cluster.routing.allocation.MoveDecision; +import org.opensearch.cluster.routing.allocation.ShardAllocationDecision; +import org.opensearch.cluster.routing.allocation.decider.Decision; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.allocation.ClusterAllocationExplanation; import static java.util.Collections.emptyMap; @@ -47,7 +47,7 @@ /** * Tests for the cluster allocation explanation */ -public final class ClusterAllocationExplanationTests extends ESTestCase { +public final class ClusterAllocationExplanationTests extends OpenSearchTestCase { public void testDecisionEquality() { Decision.Multi d = new Decision.Multi(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java index af73d7fcf19be..e6bf6bc5d5dea 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; - -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.coordination.CoordinationMetadata; -import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes.Builder; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.admin.cluster.configuration; + +import org.opensearch.Version; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.coordination.CoordinationMetadata; +import org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes.Builder; +import org.opensearch.common.Strings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.configuration.AddVotingConfigExclusionsRequest; import java.io.IOException; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; -public class AddVotingConfigExclusionsRequestTests extends ESTestCase { +public class AddVotingConfigExclusionsRequestTests extends OpenSearchTestCase { private static final String NODE_IDENTIFIERS_INCORRECTLY_SET_MSG = "Please set node identifiers correctly. " + "One and only one of [node_name], [node_names] and [node_ids] has to be set"; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java index 9f4c8015a7e1e..55db901404dd4 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponseTests.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; +package org.opensearch.action.admin.cluster.configuration; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.configuration.AddVotingConfigExclusionsResponse; import java.io.IOException; -public class AddVotingConfigExclusionsResponseTests extends ESTestCase { +public class AddVotingConfigExclusionsResponseTests extends OpenSearchTestCase { public void testSerialization() throws IOException { final AddVotingConfigExclusionsResponse originalRequest = new AddVotingConfigExclusionsResponse(); copyWriteable(originalRequest, writableRegistry(), AddVotingConfigExclusionsResponse::new); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java index 0f4984a0ec72d..2446995e3a8da 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequestTests.java @@ -16,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; +package org.opensearch.action.admin.cluster.configuration; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsRequest; import java.io.IOException; import static org.hamcrest.Matchers.equalTo; -public class ClearVotingConfigExclusionsRequestTests extends ESTestCase { +public class ClearVotingConfigExclusionsRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { final ClearVotingConfigExclusionsRequest originalRequest = new ClearVotingConfigExclusionsRequest(); if (randomBoolean()) { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java index 31f6db4c8629c..12bbbde38b48c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponseTests.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; +package org.opensearch.action.admin.cluster.configuration; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.configuration.ClearVotingConfigExclusionsResponse; import java.io.IOException; -public class ClearVotingConfigExclusionsResponseTests extends ESTestCase { +public class ClearVotingConfigExclusionsResponseTests extends OpenSearchTestCase { public void testSerialization() throws IOException { final ClearVotingConfigExclusionsResponse originalRequest = new ClearVotingConfigExclusionsResponse(); copyWriteable(originalRequest, writableRegistry(), ClearVotingConfigExclusionsResponse::new); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java index dd56c4c32f2f3..4497a3176e5c0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java @@ -16,40 +16,40 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; +package org.opensearch.action.admin.cluster.configuration; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.OpenSearchTimeoutException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchTimeoutException; +import org.opensearch.Version; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ClusterStateObserver; -import org.elasticsearch.cluster.ClusterStateObserver.Listener; -import org.elasticsearch.cluster.ClusterStateUpdateTask; -import org.elasticsearch.cluster.coordination.CoordinationMetadata; -import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; -import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfiguration; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes.Builder; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.MockTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.threadpool.ThreadPool.Names; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportResponseHandler; -import org.elasticsearch.transport.TransportService; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.ClusterStateObserver; +import org.opensearch.cluster.ClusterStateObserver.Listener; +import org.opensearch.cluster.ClusterStateUpdateTask; +import org.opensearch.cluster.coordination.CoordinationMetadata; +import org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; +import org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfiguration; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes.Builder; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.MockTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.threadpool.ThreadPool.Names; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportResponseHandler; +import org.opensearch.transport.TransportService; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -69,9 +69,9 @@ import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static org.opensearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction.MAXIMUM_VOTING_CONFIG_EXCLUSIONS_SETTING; -import static org.elasticsearch.cluster.ClusterState.builder; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.cluster.ClusterState.builder; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; @@ -79,7 +79,7 @@ import static org.hamcrest.Matchers.sameInstance; import static org.hamcrest.Matchers.startsWith; -public class TransportAddVotingConfigExclusionsActionTests extends ESTestCase { +public class TransportAddVotingConfigExclusionsActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; private static ClusterService clusterService; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java index a6161d4c90a81..67ca4d8dff0b3 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java @@ -16,34 +16,34 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.configuration; +package org.opensearch.action.admin.cluster.configuration; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.OpenSearchTimeoutException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchTimeoutException; +import org.opensearch.Version; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.coordination.CoordinationMetadata; -import org.elasticsearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.node.DiscoveryNodes.Builder; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.MockTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.threadpool.ThreadPool.Names; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportResponseHandler; -import org.elasticsearch.transport.TransportService; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.coordination.CoordinationMetadata; +import org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.node.DiscoveryNodes.Builder; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.MockTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.threadpool.ThreadPool.Names; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportResponseHandler; +import org.opensearch.transport.TransportService; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -59,15 +59,15 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.cluster.ClusterState.builder; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.cluster.ClusterState.builder; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.startsWith; -public class TransportClearVotingConfigExclusionsActionTests extends ESTestCase { +public class TransportClearVotingConfigExclusionsActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; private static ClusterService clusterService; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestTests.java index 1dd10567f0d26..5f89cdbcfbd66 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestTests.java @@ -17,25 +17,25 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.health; +package org.opensearch.action.admin.cluster.health; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.cluster.health.ClusterHealthStatus; -import org.elasticsearch.common.Priority; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.health.ClusterHealthStatus; +import org.opensearch.common.Priority; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import java.util.Locale; -import static org.elasticsearch.test.VersionUtils.getPreviousVersion; -import static org.elasticsearch.test.VersionUtils.randomVersionBetween; +import static org.opensearch.test.VersionUtils.getPreviousVersion; +import static org.opensearch.test.VersionUtils.randomVersionBetween; import static org.hamcrest.core.IsEqual.equalTo; -public class ClusterHealthRequestTests extends ESTestCase { +public class ClusterHealthRequestTests extends OpenSearchTestCase { public void testSerialize() throws Exception { final ClusterHealthRequest originalRequest = randomRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java index afc850cd39a5e..383b560d420c1 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponsesTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java @@ -17,24 +17,24 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.health; - -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.health.ClusterHealthStatus; -import org.elasticsearch.cluster.health.ClusterIndexHealth; -import org.elasticsearch.cluster.health.ClusterIndexHealthTests; -import org.elasticsearch.cluster.health.ClusterStateHealth; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; +package org.opensearch.action.admin.cluster.health; + +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.health.ClusterHealthStatus; +import org.opensearch.cluster.health.ClusterIndexHealth; +import org.opensearch.cluster.health.ClusterIndexHealthTests; +import org.opensearch.cluster.health.ClusterStateHealth; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.test.AbstractSerializingTestCase; import org.hamcrest.Matchers; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthActionTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthActionTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthActionTests.java index f37f83b658d32..c92c79c8f9596 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthActionTests.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.health; +package org.opensearch.action.admin.cluster.health; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.ActiveShardCount; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.routing.IndexRoutingTable; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.Randomness; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.routing.IndexRoutingTable; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.Randomness; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; import org.opensearch.action.admin.cluster.health.TransportClusterHealthAction; @@ -44,7 +44,7 @@ import static org.hamcrest.core.IsEqual.equalTo; -public class TransportClusterHealthActionTests extends ESTestCase { +public class TransportClusterHealthActionTests extends OpenSearchTestCase { public void testWaitForInitializingShards() throws Exception { final String[] indices = {"test"}; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfoTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodeInfoTests.java similarity index 81% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfoTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodeInfoTests.java index 873c5ef68e311..70de0b0bb393e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfoTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodeInfoTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.info; +package org.opensearch.action.admin.cluster.node.info; -import org.elasticsearch.Build; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.monitor.jvm.JvmInfo; -import org.elasticsearch.monitor.os.OsInfo; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Build; +import org.opensearch.Version; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.monitor.jvm.JvmInfo; +import org.opensearch.monitor.os.OsInfo; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.cluster.node.info.NodeInfo; import static java.util.Collections.emptyMap; @@ -35,9 +35,9 @@ /** * Tests for {@link NodeInfo}. Serialization and deserialization tested in - * {@link org.elasticsearch.nodesinfo.NodeInfoStreamingTests}. + * {@link org.opensearch.nodesinfo.NodeInfoStreamingTests}. */ -public class NodeInfoTests extends ESTestCase { +public class NodeInfoTests extends OpenSearchTestCase { /** * Check that the the {@link NodeInfo#getInfo(Class)} method returns null diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestTests.java index 0f9ebcd377012..b16ad2860384b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.info; +package org.opensearch.action.admin.cluster.node.info; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.node.info.NodesInfoRequest; import java.util.HashSet; @@ -36,7 +36,7 @@ * Granular tests for the {@link NodesInfoRequest} class. Higher-level tests * can be found in {@link org.opensearch.rest.action.admin.cluster.RestNodesInfoActionTests}. */ -public class NodesInfoRequestTests extends ESTestCase { +public class NodesInfoRequestTests extends OpenSearchTestCase { /** * Make sure that we can set, serialize, and deserialize arbitrary sets diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodeStatsTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodeStatsTests.java index d7d64801fe232..ddf8369311a62 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodeStatsTests.java @@ -17,30 +17,30 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.stats; +package org.opensearch.action.admin.cluster.node.stats; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.discovery.DiscoveryStats; -import org.elasticsearch.discovery.zen.PendingClusterStateStats; -import org.elasticsearch.discovery.zen.PublishClusterStateStats; -import org.elasticsearch.http.HttpStats; -import org.elasticsearch.indices.breaker.AllCircuitBreakerStats; -import org.elasticsearch.indices.breaker.CircuitBreakerStats; -import org.elasticsearch.ingest.IngestStats; -import org.elasticsearch.monitor.fs.FsInfo; -import org.elasticsearch.monitor.jvm.JvmStats; -import org.elasticsearch.monitor.os.OsStats; -import org.elasticsearch.monitor.process.ProcessStats; -import org.elasticsearch.node.AdaptiveSelectionStats; -import org.elasticsearch.node.ResponseCollectorService; -import org.elasticsearch.script.ScriptCacheStats; -import org.elasticsearch.script.ScriptStats; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.threadpool.ThreadPoolStats; -import org.elasticsearch.transport.TransportStats; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.discovery.DiscoveryStats; +import org.opensearch.discovery.zen.PendingClusterStateStats; +import org.opensearch.discovery.zen.PublishClusterStateStats; +import org.opensearch.http.HttpStats; +import org.opensearch.indices.breaker.AllCircuitBreakerStats; +import org.opensearch.indices.breaker.CircuitBreakerStats; +import org.opensearch.ingest.IngestStats; +import org.opensearch.monitor.fs.FsInfo; +import org.opensearch.monitor.jvm.JvmStats; +import org.opensearch.monitor.os.OsStats; +import org.opensearch.monitor.process.ProcessStats; +import org.opensearch.node.AdaptiveSelectionStats; +import org.opensearch.node.ResponseCollectorService; +import org.opensearch.script.ScriptCacheStats; +import org.opensearch.script.ScriptStats; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.threadpool.ThreadPoolStats; +import org.opensearch.transport.TransportStats; import org.opensearch.action.admin.cluster.node.stats.NodeStats; import java.io.IOException; @@ -54,7 +54,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -public class NodeStatsTests extends ESTestCase { +public class NodeStatsTests extends OpenSearchTestCase { public void testSerialization() throws IOException { NodeStats nodeStats = createNodeStats(); try (BytesStreamOutput out = new BytesStreamOutput()) { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java index 7fe763a4fa6e3..65ed6a69075c4 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestTests.java @@ -17,14 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.stats; +package org.opensearch.action.admin.cluster.node.stats; import org.opensearch.action.admin.cluster.node.stats.NodesStatsRequest; import org.opensearch.action.admin.indices.stats.CommonStatsFlags; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; - +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import java.util.HashSet; import java.util.Set; @@ -33,7 +32,7 @@ import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.not; -public class NodesStatsRequestTests extends ESTestCase { +public class NodesStatsRequestTests extends OpenSearchTestCase { /** * Make sure that we can set, serialize, and deserialize arbitrary sets diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksTests.java index 56d8d3d493b5d..06fe031ee480a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; +package org.opensearch.action.admin.cluster.node.tasks; import com.carrotsearch.randomizedtesting.RandomizedContext; import com.carrotsearch.randomizedtesting.generators.RandomNumbers; @@ -26,24 +26,23 @@ import org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; -import org.elasticsearch.action.support.ActionTestUtils; -import org.elasticsearch.action.support.nodes.BaseNodeRequest; -import org.elasticsearch.action.support.nodes.BaseNodesRequest; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.tasks.CancellableTask; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskCancelledException; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.tasks.TaskInfo; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; - +import org.opensearch.action.support.ActionTestUtils; +import org.opensearch.action.support.nodes.BaseNodeRequest; +import org.opensearch.action.support.nodes.BaseNodesRequest; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.settings.Settings; +import org.opensearch.tasks.CancellableTask; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskCancelledException; +import org.opensearch.tasks.TaskId; +import org.opensearch.tasks.TaskInfo; +import org.opensearch.tasks.TaskManager; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -58,7 +57,7 @@ import java.util.concurrent.atomic.AtomicIntegerArray; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java index 5046a48b938f6..20e1cfa8f87c8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/RecordingTaskManagerListener.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; +package org.opensearch.action.admin.cluster.node.tasks; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.regex.Regex; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskInfo; -import org.elasticsearch.test.tasks.MockTaskManagerListener; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.regex.Regex; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskInfo; +import org.opensearch.test.tasks.MockTaskManagerListener; import java.util.ArrayList; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java similarity index 82% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java index f9f2725c2c797..05bf4ef04af1b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java @@ -16,42 +16,42 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; +package org.opensearch.action.admin.cluster.node.tasks; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.FailedNodeException; import org.opensearch.action.admin.cluster.node.tasks.cancel.TransportCancelTasksAction; import org.opensearch.action.admin.cluster.node.tasks.list.TransportListTasksAction; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.nodes.BaseNodeRequest; -import org.elasticsearch.action.support.nodes.BaseNodeResponse; -import org.elasticsearch.action.support.nodes.BaseNodesRequest; -import org.elasticsearch.action.support.nodes.BaseNodesResponse; -import org.elasticsearch.action.support.nodes.TransportNodesAction; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.network.NetworkService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.BoundTransportAddress; -import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; -import org.elasticsearch.tasks.TaskCancellationService; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.tasks.MockTaskManager; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; -import org.elasticsearch.transport.nio.MockNioTransport; +import org.opensearch.action.support.nodes.BaseNodeRequest; +import org.opensearch.action.support.nodes.BaseNodeResponse; +import org.opensearch.action.support.nodes.BaseNodesRequest; +import org.opensearch.action.support.nodes.BaseNodesResponse; +import org.opensearch.action.support.nodes.TransportNodesAction; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterModule; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.network.NetworkService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.transport.BoundTransportAddress; +import org.opensearch.common.util.PageCacheRecycler; +import org.opensearch.indices.breaker.NoneCircuitBreakerService; +import org.opensearch.tasks.TaskCancellationService; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.tasks.MockTaskManager; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; +import org.opensearch.transport.nio.MockNioTransport; import org.junit.After; import org.junit.Before; @@ -65,13 +65,13 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; /** * The test case for unit testing task manager and related transport actions */ -public abstract class TaskManagerTestCase extends ESTestCase { +public abstract class TaskManagerTestCase extends OpenSearchTestCase { protected ThreadPool threadPool; protected TestNode[] testNodes; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java index 8628a8ee2c391..9344fdf8e708a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TaskTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java @@ -16,19 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; +package org.opensearch.action.admin.cluster.node.tasks; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.tasks.TaskInfo; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.tasks.TaskId; +import org.opensearch.tasks.TaskInfo; +import org.opensearch.test.OpenSearchTestCase; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Map; -public class TaskTests extends ESTestCase { +public class TaskTests extends OpenSearchTestCase { public void testTaskInfoToString() { String nodeId = randomAlphaOfLength(10); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TestTaskPlugin.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TestTaskPlugin.java index 464a82b618b39..b35eb9e049cb7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TestTaskPlugin.java @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; + +package org.opensearch.action.admin.cluster.node.tasks; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRequest; @@ -27,41 +28,41 @@ import org.opensearch.action.ActionType; import org.opensearch.action.TaskOperationFailure; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.nodes.BaseNodeRequest; -import org.elasticsearch.action.support.nodes.BaseNodeResponse; -import org.elasticsearch.action.support.nodes.BaseNodesRequest; -import org.elasticsearch.action.support.nodes.BaseNodesResponse; -import org.elasticsearch.action.support.nodes.TransportNodesAction; -import org.elasticsearch.action.support.tasks.BaseTasksRequest; -import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.action.support.tasks.TransportTasksAction; -import org.elasticsearch.client.OpenSearchClient; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContentFragment; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.plugins.ActionPlugin; -import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.plugins.NetworkPlugin; -import org.elasticsearch.tasks.CancellableTask; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportInterceptor; -import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.transport.TransportService; -import org.elasticsearch.transport.TransportRequestOptions; -import org.elasticsearch.transport.TransportResponse; -import org.elasticsearch.transport.TransportResponseHandler; +import org.opensearch.action.support.nodes.BaseNodeRequest; +import org.opensearch.action.support.nodes.BaseNodeResponse; +import org.opensearch.action.support.nodes.BaseNodesRequest; +import org.opensearch.action.support.nodes.BaseNodesResponse; +import org.opensearch.action.support.nodes.TransportNodesAction; +import org.opensearch.action.support.tasks.BaseTasksRequest; +import org.opensearch.action.support.tasks.BaseTasksResponse; +import org.opensearch.action.support.tasks.TransportTasksAction; +import org.opensearch.client.OpenSearchClient; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.inject.Inject; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.ToXContentFragment; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.plugins.ActionPlugin; +import org.opensearch.plugins.Plugin; +import org.opensearch.plugins.NetworkPlugin; +import org.opensearch.tasks.CancellableTask; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskId; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportInterceptor; +import org.opensearch.transport.TransportRequest; +import org.opensearch.transport.TransportService; +import org.opensearch.transport.TransportRequestOptions; +import org.opensearch.transport.TransportResponse; +import org.opensearch.transport.TransportResponseHandler; import java.io.IOException; import java.util.ArrayList; @@ -74,7 +75,7 @@ import java.util.Objects; import static org.opensearch.action.admin.cluster.node.tasks.get.GetTaskAction.TASKS_ORIGIN; -import static org.elasticsearch.test.ESTestCase.waitUntil; +import static org.opensearch.test.OpenSearchTestCase.waitUntil; /** * A plugin that adds a cancellable blocking test task of integration testing of the task manager. diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java index 058cd6d5969ef..5896de6c9d993 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks; - +package org.opensearch.action.admin.cluster.node.tasks; import org.opensearch.action.ActionFuture; import org.opensearch.action.ActionListener; import org.opensearch.action.FailedNodeException; @@ -29,32 +28,32 @@ import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.TaskGroup; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.nodes.BaseNodeRequest; -import org.elasticsearch.action.support.nodes.BaseNodesRequest; -import org.elasticsearch.action.support.tasks.BaseTasksRequest; -import org.elasticsearch.action.support.tasks.BaseTasksResponse; -import org.elasticsearch.action.support.tasks.TransportTasksAction; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.tasks.TaskInfo; -import org.elasticsearch.test.tasks.MockTaskManager; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.nodes.BaseNodeRequest; +import org.opensearch.action.support.nodes.BaseNodesRequest; +import org.opensearch.action.support.tasks.BaseTasksRequest; +import org.opensearch.action.support.tasks.BaseTasksResponse; +import org.opensearch.action.support.tasks.TransportTasksAction; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskId; +import org.opensearch.tasks.TaskInfo; +import org.opensearch.test.tasks.MockTaskManager; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java index a534c96e4d9d1..d1eaf23c885ea 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.node.tasks.cancel; +package org.opensearch.action.admin.cluster.node.tasks.cancel; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskId; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest; import java.util.Collections; -public class CancelTasksRequestTests extends ESTestCase { +public class CancelTasksRequestTests extends OpenSearchTestCase { public void testGetDescription() { CancelTasksRequest cancelTasksRequest = new CancelTasksRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java similarity index 81% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java index e44349e83c643..7c447560408c7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestTests.java @@ -16,25 +16,25 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.repositories.put; +package org.opensearch.action.admin.cluster.repositories.put; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.repositories.fs.FsRepository; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.repositories.fs.FsRepository; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; -public class PutRepositoryRequestTests extends ESTestCase { +public class PutRepositoryRequestTests extends OpenSearchTestCase { @SuppressWarnings("unchecked") public void testCreateRepositoryToXContent() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java index 88417a9639cbf..d53374ea147be 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponseTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.repositories.verify; +package org.opensearch.action.admin.cluster.repositories.verify; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java index 1d94f3242eb70..f0272582a66d8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java @@ -17,31 +17,31 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.reroute; - -import org.elasticsearch.action.support.master.AcknowledgedRequest; -import org.elasticsearch.action.support.master.MasterNodeRequest; -import org.elasticsearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.command.AllocateStalePrimaryAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.command.AllocationCommand; -import org.elasticsearch.cluster.routing.allocation.command.CancelAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.network.NetworkModule; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; +package org.opensearch.action.admin.cluster.reroute; + +import org.opensearch.action.support.master.AcknowledgedRequest; +import org.opensearch.action.support.master.MasterNodeRequest; +import org.opensearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand; +import org.opensearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand; +import org.opensearch.cluster.routing.allocation.command.AllocateStalePrimaryAllocationCommand; +import org.opensearch.cluster.routing.allocation.command.AllocationCommand; +import org.opensearch.cluster.routing.allocation.command.CancelAllocationCommand; +import org.opensearch.cluster.routing.allocation.command.MoveAllocationCommand; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.network.NetworkModule; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.admin.cluster.RestClusterRerouteAction; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.rest.FakeRestRequest; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.action.admin.cluster.reroute.ClusterRerouteRequest; import java.io.IOException; @@ -52,12 +52,12 @@ import java.util.function.Supplier; import static java.util.Collections.unmodifiableList; -import static org.elasticsearch.common.unit.TimeValue.timeValueMillis; +import static org.opensearch.common.unit.TimeValue.timeValueMillis; /** * Test for serialization and parsing of {@link ClusterRerouteRequest} and its commands. See the superclass for, well, everything. */ -public class ClusterRerouteRequestTests extends ESTestCase { +public class ClusterRerouteRequestTests extends OpenSearchTestCase { private static final int ROUNDS = 30; private final List> RANDOM_COMMAND_GENERATORS = unmodifiableList( Arrays.> asList( diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java index f24776e19a53c..6fb5e9e1003b9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponseTests.java @@ -17,35 +17,35 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.reroute; +package org.opensearch.action.admin.cluster.reroute; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.allocation.RerouteExplanation; -import org.elasticsearch.cluster.routing.allocation.RoutingExplanations; -import org.elasticsearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.decider.Decision; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.Version; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.allocation.RerouteExplanation; +import org.opensearch.cluster.routing.allocation.RoutingExplanations; +import org.opensearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand; +import org.opensearch.cluster.routing.allocation.decider.Decision; +import org.opensearch.common.Strings; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.transport.TransportAddress; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.IndexSettings; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.reroute.ClusterRerouteResponse; import java.io.IOException; import java.util.HashMap; import java.util.Map; -public class ClusterRerouteResponseTests extends ESTestCase { +public class ClusterRerouteResponseTests extends OpenSearchTestCase { public void testToXContent() throws IOException { DiscoveryNode node0 = new DiscoveryNode("node0", new TransportAddress(TransportAddress.META_ADDRESS, 9000), Version.CURRENT); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteTests.java similarity index 83% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteTests.java index 01e6c477435ff..c67fe09340347 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteTests.java @@ -16,33 +16,33 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.reroute; +package org.opensearch.action.admin.cluster.reroute; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ESAllocationTestCase; -import org.elasticsearch.cluster.EmptyClusterInfoService; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.allocation.AllocationService; -import org.elasticsearch.cluster.routing.allocation.FailedShard; -import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; -import org.elasticsearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand; -import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; -import org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.network.NetworkModule; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.ESAllocationTestCase; +import org.opensearch.cluster.EmptyClusterInfoService; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.allocation.AllocationService; +import org.opensearch.cluster.routing.allocation.FailedShard; +import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; +import org.opensearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand; +import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders; +import org.opensearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.network.NetworkModule; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; import org.opensearch.snapshots.EmptySnapshotsInfoService; -import org.elasticsearch.test.gateway.TestGatewayAllocator; +import org.opensearch.test.gateway.TestGatewayAllocator; import org.opensearch.action.admin.cluster.reroute.ClusterRerouteRequest; import org.opensearch.action.admin.cluster.reroute.ClusterRerouteResponse; import org.opensearch.action.admin.cluster.reroute.TransportClusterRerouteAction; @@ -52,8 +52,8 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING; -import static org.elasticsearch.cluster.routing.ShardRoutingState.UNASSIGNED; +import static org.opensearch.cluster.routing.ShardRoutingState.INITIALIZING; +import static org.opensearch.cluster.routing.ShardRoutingState.UNASSIGNED; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; @@ -167,7 +167,7 @@ private ClusterState createInitialClusterState(AllocationService service) { routingTableBuilder.addAsNew(metadata.index("idx")); RoutingTable routingTable = routingTableBuilder.build(); - ClusterState clusterState = ClusterState.builder(org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING + ClusterState clusterState = ClusterState.builder(org.opensearch.cluster.ClusterName.CLUSTER_NAME_SETTING .getDefault(Settings.EMPTY)) .metadata(metadata).routingTable(routingTable).build(); clusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder().add(newNode("node1")).add(newNode("node2"))) diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java index fd8ca0356e0f3..0e6e419c1903c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.settings; +package org.opensearch.action.admin.cluster.settings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.settings.ClusterGetSettingsResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java index 83d7f7526d5dc..b7b8f69d3c6f0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.settings; +package org.opensearch.action.admin.cluster.settings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.XContentTestUtils; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParseException; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.XContentTestUtils; import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import java.io.IOException; @@ -34,7 +34,7 @@ import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; -public class ClusterUpdateSettingsRequestTests extends ESTestCase { +public class ClusterUpdateSettingsRequestTests extends OpenSearchTestCase { public void testFromXContent() throws IOException { doFromXContentTestWithRandomFields(false); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java index 9306549769c41..feacb54703f68 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponseTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.settings; +package org.opensearch.action.admin.cluster.settings; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.Version; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.Settings.Builder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.Version; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Setting; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.Settings.Builder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/settings/SettingsUpdaterTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/settings/SettingsUpdaterTests.java index b66fe72e6a4e9..0fe9555b5e65f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/settings/SettingsUpdaterTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/settings/SettingsUpdaterTests.java @@ -16,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.settings; - -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.settings.Setting.Property; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.admin.cluster.settings; + +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Setting; +import org.opensearch.common.settings.Setting.Property; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.settings.SettingsUpdater; import java.util.ArrayList; @@ -41,12 +41,12 @@ import java.util.stream.Stream; import static java.util.Arrays.asList; -import static org.elasticsearch.common.settings.AbstractScopedSettings.ARCHIVED_SETTINGS_PREFIX; +import static org.opensearch.common.settings.AbstractScopedSettings.ARCHIVED_SETTINGS_PREFIX; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.not; -public class SettingsUpdaterTests extends ESTestCase { +public class SettingsUpdaterTests extends OpenSearchTestCase { public void testUpdateSetting() { @@ -203,11 +203,11 @@ public void testDeprecationLogging() { final ClusterState clusterState = ClusterState.builder(new ClusterName("foo")).metadata(Metadata.builder().persistentSettings(settings).build()).build(); - final Settings toApplyDebug = Settings.builder().put("logger.org.elasticsearch", "debug").build(); + final Settings toApplyDebug = Settings.builder().put("logger.org.opensearch", "debug").build(); final ClusterState afterDebug = settingsUpdater.updateSettings(clusterState, toApplyDebug, Settings.EMPTY, logger); assertSettingDeprecationsAndWarnings(new Setting[] { deprecatedSetting }); - final Settings toApplyUnset = Settings.builder().putNull("logger.org.elasticsearch").build(); + final Settings toApplyUnset = Settings.builder().putNull("logger.org.opensearch").build(); final ClusterState afterUnset = settingsUpdater.updateSettings(afterDebug, toApplyUnset, Settings.EMPTY, logger); assertSettingDeprecationsAndWarnings(new Setting[] { deprecatedSetting }); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java index ac12d17e54b4e..eee16926c87a9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.shards; +package org.opensearch.action.admin.cluster.shards; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.cluster.shards.ClusterSearchShardsRequest; -public class ClusterSearchShardsRequestTests extends ESTestCase { +public class ClusterSearchShardsRequestTests extends OpenSearchTestCase { public void testSerialization() throws Exception { ClusterSearchShardsRequest request = new ClusterSearchShardsRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java similarity index 80% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java index 609eba96341e7..051128f47e258 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponseTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.shards; +package org.opensearch.action.admin.cluster.shards; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.index.query.RandomQueryBuilder; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Version; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.transport.TransportAddress; +import org.opensearch.index.query.RandomQueryBuilder; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchModule; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.cluster.shards.ClusterSearchShardsGroup; import org.opensearch.action.admin.cluster.shards.ClusterSearchShardsResponse; @@ -48,7 +48,7 @@ import java.util.Map; import java.util.Set; -public class ClusterSearchShardsResponseTests extends ESTestCase { +public class ClusterSearchShardsResponseTests extends OpenSearchTestCase { public void testSerialization() throws Exception { Map indicesAndFilters = new HashMap<>(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java index e14e52fc339e2..3b75c5da93db1 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.create; +package org.opensearch.action.admin.cluster.snapshots.create; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.support.IndicesOptions; import org.opensearch.action.support.IndicesOptions.Option; import org.opensearch.action.support.IndicesOptions.WildcardStates; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent.MapParams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.ToXContent.MapParams; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest; import java.io.IOException; @@ -48,7 +48,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -public class CreateSnapshotRequestTests extends ESTestCase { +public class CreateSnapshotRequestTests extends OpenSearchTestCase { // tests creating XContent and parsing with source(Map) equivalency public void testToXContent() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java index 4bd0999992839..c94d314a974ad 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.create; +package org.opensearch.action.admin.cluster.snapshots.create; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.shard.ShardId; import org.opensearch.snapshots.SnapshotId; import org.opensearch.snapshots.SnapshotInfo; import org.opensearch.snapshots.SnapshotInfoTests; import org.opensearch.snapshots.SnapshotShardFailure; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java index 513fb7e7e9e7c..25708ce6a136a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponseTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.get; +package org.opensearch.action.admin.cluster.snapshots.get; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.common.UUIDs; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.shard.ShardId; import org.opensearch.snapshots.SnapshotId; import org.opensearch.snapshots.SnapshotInfo; import org.opensearch.snapshots.SnapshotInfoTests; import org.opensearch.snapshots.SnapshotShardFailure; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java index 31d482788fb20..af89111ed12ec 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.restore; +package org.opensearch.action.admin.cluster.snapshots.restore; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java index 94e5e30e551d5..0f5c99cbc4d79 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.restore; +package org.opensearch.action.admin.cluster.snapshots.restore; -import org.elasticsearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentParser; import org.opensearch.snapshots.RestoreInfo; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java index ee27f05397eb9..2fcaf7cff9260 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatusTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; import java.io.IOException; import java.util.function.Predicate; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentParserUtils; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexShardStage; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexShardStatus; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotStats; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java index 58a5b1a281610..b30426441bda5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatusTests.java @@ -17,20 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentParserUtils; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentParserUtils; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexShardStatus; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexStatus; - public class SnapshotIndexStatusTests extends AbstractXContentTestCase { @Override diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java index 44fcb2ce01afd..99f96b8d62eb4 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStatsTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; import java.io.IOException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotShardsStats; public class SnapshotShardsStatsTests extends AbstractXContentTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java index d6740d5a22344..7bc9d87ef1148 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatsTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; import java.io.IOException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotStats; public class SnapshotStatsTests extends AbstractXContentTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java index 78fd0dffb8c80..2a07d35d17363 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatusTests.java @@ -1,4 +1,4 @@ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; /* * Licensed to Elasticsearch under one or more contributor @@ -19,13 +19,13 @@ * under the License. */ -import org.elasticsearch.cluster.SnapshotsInProgress; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.cluster.SnapshotsInProgress; +import org.opensearch.common.UUIDs; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.shard.ShardId; import org.opensearch.snapshots.Snapshot; import org.opensearch.snapshots.SnapshotId; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexShardStage; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotIndexShardStatus; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotStatus; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java index ba2efe134eb91..c9e65d2221eed 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.snapshots.status; +package org.opensearch.action.admin.cluster.snapshots.status; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotStatus; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateApiTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateApiTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateApiTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateApiTests.java index c47c2c6f00168..12b0bc2e21cb2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateApiTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateApiTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.state; +package org.opensearch.action.admin.cluster.state; import org.opensearch.action.ActionFuture; import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchSingleNodeTestCase; import org.opensearch.action.admin.cluster.state.ClusterStateRequest; import org.opensearch.action.admin.cluster.state.ClusterStateResponse; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestTests.java index 0a3dda8a5ffeb..c7edb2db0655a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestTests.java @@ -17,15 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.state; +package org.opensearch.action.admin.cluster.state; -import org.elasticsearch.Version; +import org.opensearch.Version; +import org.opensearch.action.support.IndicesOptions; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; import org.opensearch.action.admin.cluster.state.ClusterStateRequest; import static org.hamcrest.CoreMatchers.equalTo; @@ -33,7 +34,7 @@ /** * Unit tests for the {@link ClusterStateRequest}. */ -public class ClusterStateRequestTests extends ESTestCase { +public class ClusterStateRequestTests extends OpenSearchTestCase { public void testSerialization() throws Exception { int iterations = randomIntBetween(5, 20); for (int i = 0; i < iterations; i++) { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateResponseTests.java similarity index 81% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateResponseTests.java index 8d7c5a9faaf99..9f32f637a53eb 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/state/ClusterStateResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.state; +package org.opensearch.action.admin.cluster.state; -import org.elasticsearch.cluster.ClusterModule; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.ClusterModule; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.cluster.state.ClusterStateResponse; public class ClusterStateResponseTests extends AbstractWireSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStatsTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/stats/AnalysisStatsTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/stats/AnalysisStatsTests.java index 9baf5b7c3bd49..f48c1bd6ac867 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/AnalysisStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/stats/AnalysisStatsTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.stats; +package org.opensearch.action.admin.cluster.stats; -import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable.Reader; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.cluster.stats.AnalysisStats; import org.opensearch.action.admin.cluster.stats.IndexFeatureStats; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodesTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodesTests.java index 5127020b76e59..0c4c3898c29b5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodesTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodesTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.stats; +package org.opensearch.action.admin.cluster.stats; import org.opensearch.action.admin.cluster.node.info.NodeInfo; import org.opensearch.action.admin.cluster.node.stats.NodeStats; -import org.elasticsearch.action.admin.cluster.node.stats.NodeStatsTests; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.network.NetworkModule; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.admin.cluster.node.stats.NodeStatsTests; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.common.network.NetworkModule; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.stats.ClusterStatsNodes; import java.util.Arrays; @@ -39,10 +39,10 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; import static org.hamcrest.Matchers.equalTo; -public class ClusterStatsNodesTests extends ESTestCase { +public class ClusterStatsNodesTests extends OpenSearchTestCase { /** * Test that empty transport/http types are not printed out as part diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingStatsTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingStatsTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingStatsTests.java index aacd9dd9b1619..859e52ef480ae 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingStatsTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.stats; +package org.opensearch.action.admin.cluster.stats; -import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable.Reader; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.cluster.stats.IndexFeatureStats; import org.opensearch.action.admin.cluster.stats.MappingStats; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingVisitorTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingVisitorTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingVisitorTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingVisitorTests.java index 443cced2fac16..deb4fca80e9ed 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/stats/MappingVisitorTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/stats/MappingVisitorTests.java @@ -17,9 +17,9 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.stats; +package org.opensearch.action.admin.cluster.stats; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.stats.MappingVisitor; import java.util.Arrays; @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Set; -public class MappingVisitorTests extends ESTestCase { +public class MappingVisitorTests extends OpenSearchTestCase { private static void collectTypes(Map mapping, Set types) { MappingVisitor.visitMapping(mapping, diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java index e2e819cafa237..b59bf3fd23cff 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponseTests.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.cluster.storedscripts.GetScriptContextResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java index a9a59af7e99a1..cfb328a4c381e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponseTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptLanguagesInfo; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.ScriptLanguagesInfo; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.cluster.storedscripts.GetScriptLanguageResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java similarity index 80% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java index 412a4af9833ef..24683187ef176 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptRequest; import java.io.IOException; -import static org.elasticsearch.test.VersionUtils.randomVersion; +import static org.opensearch.test.VersionUtils.randomVersion; import static org.hamcrest.CoreMatchers.equalTo; -public class GetStoredScriptRequestTests extends ESTestCase { +public class GetStoredScriptRequestTests extends OpenSearchTestCase { public void testGetIndexedScriptRequestSerialization() throws IOException { GetStoredScriptRequest request = new GetStoredScriptRequest("id"); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java index f751c1469d179..709772d3697b9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponseTests.java @@ -1,4 +1,4 @@ -package org.elasticsearch.action.admin.cluster.storedscripts;/* +package org.opensearch.action.admin.cluster.storedscripts;/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright @@ -17,12 +17,12 @@ * under the License. */ -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.script.Script; -import org.elasticsearch.script.StoredScriptSource; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.script.Script; +import org.opensearch.script.StoredScriptSource; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java similarity index 82% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java index 86ea0ee1b006c..5e580f39f206a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.script.StoredScriptSource; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.script.StoredScriptSource; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import java.io.IOException; import java.util.Collections; -public class PutStoredScriptRequestTests extends ESTestCase { +public class PutStoredScriptRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { PutStoredScriptRequest storedScriptRequest = new PutStoredScriptRequest("bar", "context", new BytesArray("{}"), XContentType.JSON, diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java index 7c91ce7946420..0d693c58ea44f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptContextInfo; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.ScriptContextInfo; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java index 1810cf0ba8847..d4dd5af9f0de0 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptMethodInfoSerializingTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.ScriptContextInfo.ScriptMethodInfo; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java rename to server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java index ef7f33dbc93bf..0326d0d16de9d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/storedscripts/ScriptParameterInfoSerializingTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.cluster.storedscripts; +package org.opensearch.action.admin.cluster.storedscripts; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.script.ScriptContextInfo.ScriptMethodInfo.ParameterInfo; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.ScriptContextInfo.ScriptMethodInfo.ParameterInfo; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/TransportAnalyzeActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/TransportAnalyzeActionTests.java index 268b9d216eb61..621faf46d5f55 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/TransportAnalyzeActionTests.java @@ -16,38 +16,38 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices; +package org.opensearch.action.admin.indices; import org.apache.lucene.analysis.MockTokenFilter; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.CharacterRunAutomaton; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.admin.indices.analyze.AnalyzeAction; import org.opensearch.action.admin.indices.analyze.TransportAnalyzeAction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.env.Environment; -import org.elasticsearch.env.TestEnvironment; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.analysis.AbstractCharFilterFactory; -import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; -import org.elasticsearch.index.analysis.AnalysisRegistry; -import org.elasticsearch.index.analysis.CharFilterFactory; -import org.elasticsearch.index.analysis.IndexAnalyzers; -import org.elasticsearch.index.analysis.NormalizingTokenFilterFactory; -import org.elasticsearch.index.analysis.PreConfiguredCharFilter; -import org.elasticsearch.index.analysis.TokenFilterFactory; -import org.elasticsearch.index.analysis.TokenizerFactory; -import org.elasticsearch.indices.analysis.AnalysisModule; -import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider; -import org.elasticsearch.indices.analysis.AnalysisModuleTests.AppendCharFilter; -import org.elasticsearch.plugins.AnalysisPlugin; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.IndexSettingsModule; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.UUIDs; +import org.opensearch.common.settings.Settings; +import org.opensearch.env.Environment; +import org.opensearch.env.TestEnvironment; +import org.opensearch.index.IndexService; +import org.opensearch.index.IndexSettings; +import org.opensearch.index.analysis.AbstractCharFilterFactory; +import org.opensearch.index.analysis.AbstractTokenFilterFactory; +import org.opensearch.index.analysis.AnalysisRegistry; +import org.opensearch.index.analysis.CharFilterFactory; +import org.opensearch.index.analysis.IndexAnalyzers; +import org.opensearch.index.analysis.NormalizingTokenFilterFactory; +import org.opensearch.index.analysis.PreConfiguredCharFilter; +import org.opensearch.index.analysis.TokenFilterFactory; +import org.opensearch.index.analysis.TokenizerFactory; +import org.opensearch.indices.analysis.AnalysisModule; +import org.opensearch.indices.analysis.AnalysisModule.AnalysisProvider; +import org.opensearch.indices.analysis.AnalysisModuleTests.AppendCharFilter; +import org.opensearch.plugins.AnalysisPlugin; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.IndexSettingsModule; import java.io.IOException; import java.io.Reader; @@ -64,7 +64,7 @@ * Tests for {@link TransportAnalyzeAction}. See the rest tests in the {@code analysis-common} module for places where this code gets a ton * more exercise. */ -public class TransportAnalyzeActionTests extends ESTestCase { +public class TransportAnalyzeActionTests extends OpenSearchTestCase { private IndexAnalyzers indexAnalyzers; private IndexSettings indexSettings; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java b/server/src/test/java/org/opensearch/action/admin/indices/alias/AliasActionsTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/alias/AliasActionsTests.java index 57a71ec6358d4..4504018e5f67b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/AliasActionsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/alias/AliasActionsTests.java @@ -17,35 +17,35 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.alias; +package org.opensearch.action.admin.indices.alias; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParseException; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomAliasAction; -import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomMap; -import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomRouting; +import static org.opensearch.index.alias.RandomAliasActionsGenerator.randomAliasAction; +import static org.opensearch.index.alias.RandomAliasActionsGenerator.randomMap; +import static org.opensearch.index.alias.RandomAliasActionsGenerator.randomRouting; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; -public class AliasActionsTests extends ESTestCase { +public class AliasActionsTests extends OpenSearchTestCase { public void testValidate() { AliasActions.Type type = randomFrom(AliasActions.Type.values()); if (type == AliasActions.Type.REMOVE_INDEX) { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestTests.java similarity index 81% rename from server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestTests.java index 0b153e6c71596..ab143bcfd2752 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestTests.java @@ -17,22 +17,21 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.alias; +package org.opensearch.action.admin.indices.alias; -import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; -import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomAliasAction; +import static org.opensearch.index.alias.RandomAliasActionsGenerator.randomAliasAction; import static org.hamcrest.CoreMatchers.equalTo; -public class IndicesAliasesRequestTests extends ESTestCase { +public class IndicesAliasesRequestTests extends OpenSearchTestCase { public void testToAndFromXContent() throws IOException { IndicesAliasesRequest indicesAliasesRequest = createTestInstance(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponseTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponseTests.java index 9fd23c40bc469..f2918c55111b7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponseTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.alias.get; +package org.opensearch.action.admin.indices.alias.get; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.AliasMetadata.Builder; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.AliasMetadata.Builder; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.alias.get.GetAliasesResponse; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java index efd638b48e4b2..8f41040e52662 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesActionTests.java @@ -16,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.alias.get; - -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.indices.SystemIndexDescriptor; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.admin.indices.alias.get; + +import org.opensearch.Version; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.indices.SystemIndexDescriptor; +import org.opensearch.indices.SystemIndices; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.TransportGetAliasesAction; @@ -35,7 +35,7 @@ import static org.hamcrest.Matchers.equalTo; -public class TransportGetAliasesActionTests extends ESTestCase { +public class TransportGetAliasesActionTests extends OpenSearchTestCase { private final SystemIndices EMPTY_SYSTEM_INDICES = new SystemIndices(Collections.emptyMap()); public void testPostProcess() { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestTests.java index 0d782b5fba3ac..dd9551b872aba 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.analyze; +package org.opensearch.action.admin.indices.analyze; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.analyze.AnalyzeAction; import java.io.IOException; import static org.hamcrest.CoreMatchers.containsString; -public class AnalyzeRequestTests extends ESTestCase { +public class AnalyzeRequestTests extends OpenSearchTestCase { public void testValidation() { AnalyzeAction.Request request = new AnalyzeAction.Request(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeResponseTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeResponseTests.java index 97b7d474ecf03..d2b301579d18d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/analyze/AnalyzeResponseTests.java @@ -17,18 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.analyze; +package org.opensearch.action.admin.indices.analyze; -import org.opensearch.action.admin.indices.analyze.AnalyzeAction; import org.opensearch.action.admin.indices.analyze.AnalyzeAction.AnalyzeToken; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.Writeable.Reader; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.Writeable.Reader; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.test.AbstractWireSerializingTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java index 804c1b6151c4f..e751fc5789249 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.cache.clear; +package org.opensearch.action.admin.indices.cache.clear; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractBroadcastResponseTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractBroadcastResponseTestCase; import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexRequestTests.java index b2d6bbba5dddb..fa61501f7f077 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexRequestTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.close; +package org.opensearch.action.admin.indices.close; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.ActiveShardCount; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.tasks.TaskId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.indices.close.CloseIndexRequest; -public class CloseIndexRequestTests extends ESTestCase { +public class CloseIndexRequestTests extends OpenSearchTestCase { public void testSerialization() throws Exception { final CloseIndexRequest request = randomRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexResponseTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexResponseTests.java index 0d2ef4667735c..a62982eaf098b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/close/CloseIndexResponseTests.java @@ -17,27 +17,26 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.close; +package org.opensearch.action.admin.indices.close; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchException; +import org.opensearch.Version; import org.opensearch.action.NoShardAvailableActionException; -import org.opensearch.action.admin.indices.close.CloseIndexResponse; import org.opensearch.action.admin.indices.close.CloseIndexResponse.IndexResult; -import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.transport.ActionNotFoundTransportException; +import org.opensearch.action.support.master.AcknowledgedResponse; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.Index; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.AbstractWireSerializingTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.transport.ActionNotFoundTransportException; import java.io.IOException; import java.util.ArrayList; @@ -45,7 +44,7 @@ import java.util.Collections; import java.util.List; -import static org.elasticsearch.test.VersionUtils.randomVersionBetween; +import static org.opensearch.test.VersionUtils.randomVersionBetween; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java index 42982e63d439d..b9c2abe986f0d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java @@ -16,43 +16,43 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.close; +package org.opensearch.action.admin.indices.close; import org.apache.lucene.util.SetOnce; import org.opensearch.action.ActionListener; import org.opensearch.action.admin.indices.flush.FlushRequest; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.replication.PendingReplicationActions; -import org.elasticsearch.action.support.replication.ReplicationOperation; -import org.elasticsearch.action.support.replication.ReplicationResponse; -import org.elasticsearch.action.support.replication.TransportReplicationAction; -import org.elasticsearch.action.support.replication.TransportReplicationAction.ConcreteShardRequest; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.MetadataIndexStateService; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.engine.Engine; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.ReplicationGroup; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportResponse; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.replication.PendingReplicationActions; +import org.opensearch.action.support.replication.ReplicationOperation; +import org.opensearch.action.support.replication.ReplicationResponse; +import org.opensearch.action.support.replication.TransportReplicationAction; +import org.opensearch.action.support.replication.TransportReplicationAction.ConcreteShardRequest; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.MetadataIndexStateService; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.engine.Engine; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.ReplicationGroup; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.IndicesService; +import org.opensearch.tasks.TaskId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportResponse; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -66,9 +66,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.state; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.state; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; @@ -81,7 +81,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class TransportVerifyShardBeforeCloseActionTests extends ESTestCase { +public class TransportVerifyShardBeforeCloseActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/AutoCreateActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/create/AutoCreateActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/create/AutoCreateActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/create/AutoCreateActionTests.java index 01ca27ee46553..7a6a393cb48dc 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/AutoCreateActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/create/AutoCreateActionTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.create; +package org.opensearch.action.admin.indices.create; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate.DataStreamTemplate; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplate.DataStreamTemplate; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.create.AutoCreateAction; import org.opensearch.action.admin.indices.create.CreateIndexRequest; @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class AutoCreateActionTests extends ESTestCase { +public class AutoCreateActionTests extends OpenSearchTestCase { public void testResolveAutoCreateDataStreams() { Metadata metadata; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java index 0654d60bfcc24..913f8dc84258b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilderTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.create; - -import org.elasticsearch.OpenSearchParseException; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.client.NoOpClient; +package org.opensearch.action.admin.indices.create; + +import org.opensearch.OpenSearchParseException; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.client.NoOpClient; import org.junit.After; import org.junit.Before; import org.opensearch.action.admin.indices.create.CreateIndexAction; @@ -37,7 +37,7 @@ import java.util.Locale; import java.util.Map; -public class CreateIndexRequestBuilderTests extends ESTestCase { +public class CreateIndexRequestBuilderTests extends OpenSearchTestCase { private static final String KEY = "my.settings.key"; private static final String VALUE = "my.settings.value"; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestTests.java index ecace36074d91..25be92ea62f62 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexRequestTests.java @@ -17,37 +17,37 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.create; +package org.opensearch.action.admin.indices.create; -import org.elasticsearch.OpenSearchParseException; +import org.opensearch.OpenSearchParseException; import org.opensearch.action.admin.indices.alias.Alias; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.RandomCreateIndexGenerator; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.MapBuilder; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.LoggingDeprecationHandler; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.RandomCreateIndexGenerator; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.hamcrest.OpenSearchAssertions; import org.opensearch.action.admin.indices.create.CreateIndexRequest; import java.io.IOException; import java.util.Map; import java.util.Set; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; +import static org.opensearch.common.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.CoreMatchers.equalTo; -public class CreateIndexRequestTests extends ESTestCase { +public class CreateIndexRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { CreateIndexRequest request = new CreateIndexRequest("foo"); @@ -195,7 +195,7 @@ public void testToAndFromXContent() throws IOException { assertEquals(createIndexRequest.settings(), parsedCreateIndexRequest.settings()); BytesReference finalBytes = toShuffledXContent(parsedCreateIndexRequest, xContentType, EMPTY_PARAMS, humanReadable); - ElasticsearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); + OpenSearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); } public void testSettingsType() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexResponseTests.java index 16dfa1c385aa7..f2b119a95dd2e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/create/CreateIndexResponseTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.create; +package org.opensearch.action.admin.indices.create; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.create.CreateIndexResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java index 5882438e614cc..3c853bde994d9 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponseTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.dangling.list; +package org.opensearch.action.admin.indices.dangling.list; import org.opensearch.action.admin.indices.dangling.DanglingIndexInfo; import org.opensearch.action.admin.indices.dangling.list.ListDanglingIndicesResponse; import org.opensearch.action.admin.indices.dangling.list.ListDanglingIndicesResponse.AggregatedDanglingIndexInfo; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.dangling.list.NodeListDanglingIndicesResponse; import java.util.ArrayList; @@ -41,7 +41,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class ListDanglingIndicesResponseTests extends ESTestCase { +public class ListDanglingIndicesResponseTests extends OpenSearchTestCase { public static final String UUID_1 = UUID.randomUUID().toString(); public static final String UUID_2 = UUID.randomUUID().toString(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java index 00e94ff3ed00a..3b134bd0fbc22 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamRequestTests.java @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.datastream; +package org.opensearch.action.admin.indices.datastream; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.admin.indices.datastream.CreateDataStreamAction; import org.opensearch.action.admin.indices.datastream.CreateDataStreamAction.Request; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java index 419ff5ef2b623..3457ec7122442 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsResponseTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.datastream; +package org.opensearch.action.admin.indices.datastream; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.datastream.DataStreamsStatsAction; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java index 0d5b1a56b9321..5d1eda0c80b3b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamRequestTests.java @@ -16,29 +16,29 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.datastream; +package org.opensearch.action.admin.indices.datastream; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.admin.indices.datastream.DeleteDataStreamAction; import org.opensearch.action.admin.indices.datastream.DeleteDataStreamAction.Request; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.SnapshotsInProgress; -import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.metadata.MetadataDeleteIndexService; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.Index; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.SnapshotsInProgress; +import org.opensearch.cluster.metadata.DataStream; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.metadata.MetadataDeleteIndexService; +import org.opensearch.common.Strings; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.Index; import org.opensearch.snapshots.Snapshot; import org.opensearch.snapshots.SnapshotId; import org.opensearch.snapshots.SnapshotInProgressException; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.util.ArrayList; import java.util.Arrays; @@ -47,7 +47,7 @@ import java.util.Set; import java.util.stream.Collectors; -import static org.elasticsearch.cluster.DataStreamTestHelper.createTimestampField; +import static org.opensearch.cluster.DataStreamTestHelper.createTimestampField; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -83,9 +83,9 @@ public void testValidateRequestWithoutName() { public void testDeleteDataStream() { final String dataStreamName = "my-data-stream"; - final List otherIndices = randomSubsetOf(org.elasticsearch.common.collect.List.of("foo", "bar", "baz")); + final List otherIndices = randomSubsetOf(org.opensearch.common.collect.List.of("foo", "bar", "baz")); ClusterState cs = getClusterStateWithDataStreams( - org.elasticsearch.common.collect.List.of(new Tuple<>(dataStreamName, 2)), otherIndices); + org.opensearch.common.collect.List.of(new Tuple<>(dataStreamName, 2)), otherIndices); DeleteDataStreamAction.Request req = new DeleteDataStreamAction.Request(new String[]{dataStreamName}); ClusterState newState = DeleteDataStreamAction.TransportAction.removeDataStream(getMetadataDeleteIndexService(), cs, req); assertThat(newState.metadata().dataStreams().size(), equalTo(0)); @@ -97,12 +97,12 @@ public void testDeleteDataStream() { public void testDeleteMultipleDataStreams() { String[] dataStreamNames = {"foo", "bar", "baz", "eggplant"}; - ClusterState cs = getClusterStateWithDataStreams(org.elasticsearch.common.collect.List.of( + ClusterState cs = getClusterStateWithDataStreams(org.opensearch.common.collect.List.of( new Tuple<>(dataStreamNames[0], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[1], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[2], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[3], randomIntBetween(1, 3)) - ), org.elasticsearch.common.collect.List.of()); + ), org.opensearch.common.collect.List.of()); DeleteDataStreamAction.Request req = new DeleteDataStreamAction.Request(new String[]{"ba*", "eggplant"}); ClusterState newState = DeleteDataStreamAction.TransportAction.removeDataStream(getMetadataDeleteIndexService(), cs, req); @@ -144,12 +144,12 @@ private SnapshotsInProgress.Entry createEntry(String dataStreamName, String repo public void testDeleteNonexistentDataStream() { final String dataStreamName = "my-data-stream"; String[] dataStreamNames = {"foo", "bar", "baz", "eggplant"}; - ClusterState cs = getClusterStateWithDataStreams(org.elasticsearch.common.collect.List.of( + ClusterState cs = getClusterStateWithDataStreams(org.opensearch.common.collect.List.of( new Tuple<>(dataStreamNames[0], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[1], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[2], randomIntBetween(1, 3)), new Tuple<>(dataStreamNames[3], randomIntBetween(1, 3)) - ), org.elasticsearch.common.collect.List.of()); + ), org.opensearch.common.collect.List.of()); DeleteDataStreamAction.Request req = new DeleteDataStreamAction.Request(new String[]{dataStreamName}); ClusterState newState = DeleteDataStreamAction.TransportAction.removeDataStream(getMetadataDeleteIndexService(), cs, req); assertThat(newState.metadata().dataStreams().size(), equalTo(cs.metadata().dataStreams().size())); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java index fa7c350a187e3..9b8cee7af0944 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsRequestTests.java @@ -16,24 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.datastream; +package org.opensearch.action.admin.indices.datastream; import org.opensearch.action.admin.indices.datastream.GetDataStreamAction; import org.opensearch.action.admin.indices.datastream.GetDataStreamAction.Request; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.DataStream; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.util.List; -import static org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamRequestTests.getClusterStateWithDataStreams; +import static org.opensearch.action.admin.indices.datastream.DeleteDataStreamRequestTests.getClusterStateWithDataStreams; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -71,7 +71,7 @@ protected Request createTestInstance() { public void testGetDataStream() { final String dataStreamName = "my-data-stream"; ClusterState cs = getClusterStateWithDataStreams( - org.elasticsearch.common.collect.List.of(new Tuple<>(dataStreamName, 1)), org.elasticsearch.common.collect.List.of()); + org.opensearch.common.collect.List.of(new Tuple<>(dataStreamName, 1)), org.opensearch.common.collect.List.of()); GetDataStreamAction.Request req = new GetDataStreamAction.Request(new String[]{dataStreamName}); List dataStreams = GetDataStreamAction.TransportAction.getDataStreams(cs, new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), req); @@ -82,8 +82,8 @@ public void testGetDataStream() { public void testGetDataStreamsWithWildcards() { final String[] dataStreamNames = {"my-data-stream", "another-data-stream"}; ClusterState cs = getClusterStateWithDataStreams( - org.elasticsearch.common.collect.List.of(new Tuple<>(dataStreamNames[0], 1), new Tuple<>(dataStreamNames[1], 1)), - org.elasticsearch.common.collect.List.of()); + org.opensearch.common.collect.List.of(new Tuple<>(dataStreamNames[0], 1), new Tuple<>(dataStreamNames[1], 1)), + org.opensearch.common.collect.List.of()); GetDataStreamAction.Request req = new GetDataStreamAction.Request(new String[]{dataStreamNames[1].substring(0, 5) + "*"}); List dataStreams = GetDataStreamAction.TransportAction.getDataStreams(cs, @@ -114,8 +114,8 @@ public void testGetDataStreamsWithWildcards() { public void testGetDataStreamsWithoutWildcards() { final String[] dataStreamNames = {"my-data-stream", "another-data-stream"}; ClusterState cs = getClusterStateWithDataStreams( - org.elasticsearch.common.collect.List.of(new Tuple<>(dataStreamNames[0], 1), new Tuple<>(dataStreamNames[1], 1)), - org.elasticsearch.common.collect.List.of()); + org.opensearch.common.collect.List.of(new Tuple<>(dataStreamNames[0], 1), new Tuple<>(dataStreamNames[1], 1)), + org.opensearch.common.collect.List.of()); GetDataStreamAction.Request req = new GetDataStreamAction.Request(new String[]{dataStreamNames[0], dataStreamNames[1]}); List dataStreams = GetDataStreamAction.TransportAction.getDataStreams(cs, diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java index bf39ce0cc9f09..9e2d960004445 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/datastream/GetDataStreamsResponseTests.java @@ -16,14 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.datastream; +package org.opensearch.action.admin.indices.datastream; import org.opensearch.action.admin.indices.datastream.GetDataStreamAction.Response; -import org.elasticsearch.cluster.health.ClusterHealthStatus; -import org.elasticsearch.cluster.metadata.DataStreamTests; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; - +import org.opensearch.cluster.health.ClusterHealthStatus; +import org.opensearch.cluster.metadata.DataStreamTests; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.util.ArrayList; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/flush/FlushResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/flush/FlushResponseTests.java index 7ba3cc163128f..31a87145d52ed 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/FlushResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/flush/FlushResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.flush; +package org.opensearch.action.admin.indices.flush; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractBroadcastResponseTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractBroadcastResponseTestCase; import org.opensearch.action.admin.indices.flush.FlushResponse; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushUnitTests.java b/server/src/test/java/org/opensearch/action/admin/indices/flush/SyncedFlushUnitTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushUnitTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/flush/SyncedFlushUnitTests.java index 7aca09b517bfe..2abe289547068 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushUnitTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/flush/SyncedFlushUnitTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.flush; +package org.opensearch.action.admin.indices.flush; import com.carrotsearch.hppc.ObjectIntHashMap; import com.carrotsearch.hppc.ObjectIntMap; import org.opensearch.action.admin.indices.flush.SyncedFlushResponse; import org.opensearch.action.admin.indices.flush.SyncedFlushResponse.ShardCounts; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.flush.ShardsSyncedFlushResult; -import org.elasticsearch.indices.flush.SyncedFlushService; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.flush.ShardsSyncedFlushResult; +import org.opensearch.indices.flush.SyncedFlushService; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.ArrayList; @@ -40,11 +40,11 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.test.XContentTestUtils.convertToMap; +import static org.opensearch.test.XContentTestUtils.convertToMap; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; -public class SyncedFlushUnitTests extends ESTestCase { +public class SyncedFlushUnitTests extends OpenSearchTestCase { private static class TestPlan { public SyncedFlushResponse.ShardCounts totalCounts; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java index 81684593ae06e..558512ddd0582 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.forcemerge; +package org.opensearch.action.admin.indices.forcemerge; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.forcemerge.ForceMergeRequest; -public class ForceMergeRequestTests extends ESTestCase { +public class ForceMergeRequestTests extends OpenSearchTestCase { public void testDescription() { ForceMergeRequest request = new ForceMergeRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java index ac9538290cfc5..13f1eee645a14 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.forcemerge; +package org.opensearch.action.admin.indices.forcemerge; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractBroadcastResponseTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractBroadcastResponseTestCase; import org.opensearch.action.admin.indices.forcemerge.ForceMergeResponse; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java index b6ee0bbfde0cd..e526f76d65b3b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/forcemerge/RestForceMergeActionTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.forcemerge; +package org.opensearch.action.admin.indices.forcemerge; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.opensearch.client.node.NodeClient; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.admin.indices.RestForceMergeAction; -import org.elasticsearch.test.rest.FakeRestChannel; -import org.elasticsearch.test.rest.FakeRestRequest; -import org.elasticsearch.test.rest.RestActionTestCase; +import org.opensearch.test.rest.FakeRestChannel; +import org.opensearch.test.rest.FakeRestRequest; +import org.opensearch.test.rest.RestActionTestCase; import org.junit.Before; import java.util.HashMap; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java index 704c1ebbd88f7..57503bca6e963 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java @@ -17,27 +17,27 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.get; +package org.opensearch.action.admin.indices.get; import org.opensearch.action.ActionListener; import org.opensearch.action.IndicesRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.Index; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.test.ESSingleNodeTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.SettingsFilter; +import org.opensearch.common.settings.SettingsModule; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.Index; +import org.opensearch.indices.IndicesService; +import org.opensearch.test.OpenSearchSingleNodeTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.Before; import org.opensearch.action.admin.indices.get.GetIndexRequest; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexResponseTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexResponseTests.java index 23f3a33c465c1..56a91d6e0a444 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/get/GetIndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexResponseTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.get; +package org.opensearch.action.admin.indices.get; import org.apache.lucene.util.CollectionUtil; -import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponseTests; -import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponseTests; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.MappingMetadata; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.RandomCreateIndexGenerator; +import org.opensearch.action.admin.indices.alias.get.GetAliasesResponseTests; +import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponseTests; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.MappingMetadata; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.RandomCreateIndexGenerator; import org.opensearch.rest.BaseRestHandler; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.get.GetIndexResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java index 933973dc90ce6..1bade3fa3e751 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.mapping.get; +package org.opensearch.action.admin.indices.mapping.get; import org.opensearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; import org.opensearch.action.admin.indices.mapping.get.GetFieldMappingsResponse.FieldMappingMetadata; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.LoggingDeprecationHandler; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java index 1165cb8a89f04..d6233345d9c1a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponseTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.mapping.get; +package org.opensearch.action.admin.indices.mapping.get; import com.carrotsearch.hppc.cursors.ObjectCursor; -import org.elasticsearch.cluster.metadata.MappingMetadata; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.ToXContent.Params; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.MapperService; +import org.opensearch.cluster.metadata.MappingMetadata; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.ToXContent.Params; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.mapper.MapperService; import org.opensearch.rest.BaseRestHandler; -import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.opensearch.test.AbstractSerializingTestCase; +import org.opensearch.test.EqualsHashCodeTestUtils; import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestTests.java similarity index 74% rename from server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestTests.java index a7efc63c47b13..2388745320eb7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestTests.java @@ -17,28 +17,28 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.mapping.put; +package org.opensearch.action.admin.indices.mapping.put; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamRequestTests; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.IndexAbstraction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.RandomCreateIndexGenerator; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.admin.indices.datastream.DeleteDataStreamRequestTests; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.IndexAbstraction; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.Index; +import org.opensearch.index.RandomCreateIndexGenerator; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest; import org.opensearch.action.admin.indices.mapping.put.TransportPutMappingAction; @@ -47,12 +47,12 @@ import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.common.collect.Tuple.tuple; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.common.collect.Tuple.tuple; +import static org.opensearch.common.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; -public class PutMappingRequestTests extends ESTestCase { +public class PutMappingRequestTests extends OpenSearchTestCase { public void testValidation() { PutMappingRequest r = new PutMappingRequest("myindex").type(""); @@ -160,16 +160,16 @@ private static PutMappingRequest createTestItem() throws IOException { public void testResolveIndicesWithWriteIndexOnlyAndDataStreamsAndWriteAliases() { String[] dataStreamNames = {"foo", "bar", "baz"}; - List> dsMetadata = org.elasticsearch.common.collect.List.of( + List> dsMetadata = org.opensearch.common.collect.List.of( tuple(dataStreamNames[0], randomIntBetween(1, 3)), tuple(dataStreamNames[1], randomIntBetween(1, 3)), tuple(dataStreamNames[2], randomIntBetween(1, 3))); ClusterState cs = DeleteDataStreamRequestTests.getClusterStateWithDataStreams(dsMetadata, - org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); - cs = addAliases(cs, org.elasticsearch.common.collect.List.of( - tuple("alias1", org.elasticsearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), - tuple("alias2", org.elasticsearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) + org.opensearch.common.collect.List.of("index1", "index2", "index3")); + cs = addAliases(cs, org.opensearch.common.collect.List.of( + tuple("alias1", org.opensearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), + tuple("alias2", org.opensearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) )); PutMappingRequest request = new PutMappingRequest().indices("foo", "alias1", "alias2").writeIndexOnly(true); Index[] indices = TransportPutMappingAction.resolveIndices(cs, request, @@ -182,16 +182,16 @@ public void testResolveIndicesWithWriteIndexOnlyAndDataStreamsAndWriteAliases() public void testResolveIndicesWithoutWriteIndexOnlyAndDataStreamsAndWriteAliases() { String[] dataStreamNames = {"foo", "bar", "baz"}; - List> dsMetadata = org.elasticsearch.common.collect.List.of( + List> dsMetadata = org.opensearch.common.collect.List.of( tuple(dataStreamNames[0], randomIntBetween(1, 3)), tuple(dataStreamNames[1], randomIntBetween(1, 3)), tuple(dataStreamNames[2], randomIntBetween(1, 3))); ClusterState cs = DeleteDataStreamRequestTests.getClusterStateWithDataStreams(dsMetadata, - org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); - cs = addAliases(cs, org.elasticsearch.common.collect.List.of( - tuple("alias1", org.elasticsearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), - tuple("alias2", org.elasticsearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) + org.opensearch.common.collect.List.of("index1", "index2", "index3")); + cs = addAliases(cs, org.opensearch.common.collect.List.of( + tuple("alias1", org.opensearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), + tuple("alias2", org.opensearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) )); PutMappingRequest request = new PutMappingRequest().indices("foo", "alias1", "alias2"); Index[] indices = TransportPutMappingAction.resolveIndices(cs, request, @@ -199,23 +199,23 @@ public void testResolveIndicesWithoutWriteIndexOnlyAndDataStreamsAndWriteAliases List indexNames = Arrays.stream(indices).map(Index::getName).collect(Collectors.toList()); IndexAbstraction expectedDs = cs.metadata().getIndicesLookup().get("foo"); List expectedIndices = expectedDs.getIndices().stream().map(im -> im.getIndex().getName()).collect(Collectors.toList()); - expectedIndices.addAll(org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); + expectedIndices.addAll(org.opensearch.common.collect.List.of("index1", "index2", "index3")); // should resolve the data stream and each alias to _all_ their respective indices assertThat(indexNames, containsInAnyOrder(expectedIndices.toArray())); } public void testResolveIndicesWithWriteIndexOnlyAndDataStreamAndIndex() { String[] dataStreamNames = {"foo", "bar", "baz"}; - List> dsMetadata = org.elasticsearch.common.collect.List.of( + List> dsMetadata = org.opensearch.common.collect.List.of( tuple(dataStreamNames[0], randomIntBetween(1, 3)), tuple(dataStreamNames[1], randomIntBetween(1, 3)), tuple(dataStreamNames[2], randomIntBetween(1, 3))); ClusterState cs = DeleteDataStreamRequestTests.getClusterStateWithDataStreams(dsMetadata, - org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); - cs = addAliases(cs, org.elasticsearch.common.collect.List.of( - tuple("alias1", org.elasticsearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), - tuple("alias2", org.elasticsearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) + org.opensearch.common.collect.List.of("index1", "index2", "index3")); + cs = addAliases(cs, org.opensearch.common.collect.List.of( + tuple("alias1", org.opensearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), + tuple("alias2", org.opensearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) )); PutMappingRequest request = new PutMappingRequest().indices("foo", "index3").writeIndexOnly(true); Index[] indices = TransportPutMappingAction.resolveIndices(cs, request, @@ -223,23 +223,23 @@ public void testResolveIndicesWithWriteIndexOnlyAndDataStreamAndIndex() { List indexNames = Arrays.stream(indices).map(Index::getName).collect(Collectors.toList()); IndexAbstraction expectedDs = cs.metadata().getIndicesLookup().get("foo"); List expectedIndices = expectedDs.getIndices().stream().map(im -> im.getIndex().getName()).collect(Collectors.toList()); - expectedIndices.addAll(org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); + expectedIndices.addAll(org.opensearch.common.collect.List.of("index1", "index2", "index3")); // should resolve the data stream and each alias to _all_ their respective indices assertThat(indexNames, containsInAnyOrder(expectedDs.getWriteIndex().getIndex().getName(), "index3")); } public void testResolveIndicesWithWriteIndexOnlyAndNoSingleWriteIndex() { String[] dataStreamNames = {"foo", "bar", "baz"}; - List> dsMetadata = org.elasticsearch.common.collect.List.of( + List> dsMetadata = org.opensearch.common.collect.List.of( tuple(dataStreamNames[0], randomIntBetween(1, 3)), tuple(dataStreamNames[1], randomIntBetween(1, 3)), tuple(dataStreamNames[2], randomIntBetween(1, 3))); ClusterState cs = DeleteDataStreamRequestTests.getClusterStateWithDataStreams(dsMetadata, - org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); - final ClusterState cs2 = addAliases(cs, org.elasticsearch.common.collect.List.of( - tuple("alias1", org.elasticsearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), - tuple("alias2", org.elasticsearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) + org.opensearch.common.collect.List.of("index1", "index2", "index3")); + final ClusterState cs2 = addAliases(cs, org.opensearch.common.collect.List.of( + tuple("alias1", org.opensearch.common.collect.List.of(tuple("index1", false), tuple("index2", true))), + tuple("alias2", org.opensearch.common.collect.List.of(tuple("index2", false), tuple("index3", true))) )); PutMappingRequest request = new PutMappingRequest().indices("*").writeIndexOnly(true); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, @@ -250,16 +250,16 @@ public void testResolveIndicesWithWriteIndexOnlyAndNoSingleWriteIndex() { public void testResolveIndicesWithWriteIndexOnlyAndAliasWithoutWriteIndex() { String[] dataStreamNames = {"foo", "bar", "baz"}; - List> dsMetadata = org.elasticsearch.common.collect.List.of( + List> dsMetadata = org.opensearch.common.collect.List.of( tuple(dataStreamNames[0], randomIntBetween(1, 3)), tuple(dataStreamNames[1], randomIntBetween(1, 3)), tuple(dataStreamNames[2], randomIntBetween(1, 3))); ClusterState cs = DeleteDataStreamRequestTests.getClusterStateWithDataStreams(dsMetadata, - org.elasticsearch.common.collect.List.of("index1", "index2", "index3")); - final ClusterState cs2 = addAliases(cs, org.elasticsearch.common.collect.List.of( - tuple("alias1", org.elasticsearch.common.collect.List.of(tuple("index1", false), tuple("index2", false))), - tuple("alias2", org.elasticsearch.common.collect.List.of(tuple("index2", false), tuple("index3", false))) + org.opensearch.common.collect.List.of("index1", "index2", "index3")); + final ClusterState cs2 = addAliases(cs, org.opensearch.common.collect.List.of( + tuple("alias1", org.opensearch.common.collect.List.of(tuple("index1", false), tuple("index2", false))), + tuple("alias2", org.opensearch.common.collect.List.of(tuple("index2", false), tuple("index3", false))) )); PutMappingRequest request = new PutMappingRequest().indices("alias2").writeIndexOnly(true); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/open/OpenIndexResponseTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/open/OpenIndexResponseTests.java index 93a096701368e..ee30750d2f109 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/open/OpenIndexResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.open; +package org.opensearch.action.admin.indices.open; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.open.OpenIndexResponse; public class OpenIndexResponseTests extends AbstractSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/refresh/RefreshResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/refresh/RefreshResponseTests.java index 76637bd50f171..21a68258bed0a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/refresh/RefreshResponseTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.refresh; +package org.opensearch.action.admin.indices.refresh; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractBroadcastResponseTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractBroadcastResponseTestCase; import org.opensearch.action.admin.indices.refresh.RefreshResponse; import java.util.List; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexRequestTests.java index b1391b98a7ff0..ed48588f0e89d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexRequestTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.resolve; +package org.opensearch.action.admin.indices.resolve; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.Request; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; public class ResolveIndexRequestTests extends AbstractWireSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexResponseTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexResponseTests.java index f27eadb391f38..0db64f93132ad 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexResponseTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.resolve; +package org.opensearch.action.admin.indices.resolve; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedAlias; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedDataStream; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedIndex; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.Response; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ConstructingObjectParser; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ConstructingObjectParser; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.ArrayList; @@ -80,7 +80,7 @@ private static ResolvedIndex createTestResolvedIndexInstance() { String name = randomAlphaOfLength(6); String[] aliases = randomStringArray(0, 5); String[] attributes = randomSubsetOf( - org.elasticsearch.common.collect.List.of("open", "hidden", "frozen")).toArray(Strings.EMPTY_ARRAY); + org.opensearch.common.collect.List.of("open", "hidden", "frozen")).toArray(Strings.EMPTY_ARRAY); String dataStream = randomBoolean() ? randomAlphaOfLength(6) : null; return new ResolvedIndex(name, aliases, attributes, dataStream); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexTests.java index b6f9fb31cc787..4b0a8f9db050c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/resolve/ResolveIndexTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/resolve/ResolveIndexTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.resolve; +package org.opensearch.action.admin.indices.resolve; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.Request; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedAlias; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedDataStream; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.ResolvedIndex; import org.opensearch.action.admin.indices.resolve.ResolveIndexAction.TransportAction; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.cluster.metadata.IndexAbstractionResolver; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.time.DateFormatter; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.DataStream; +import org.opensearch.cluster.metadata.IndexAbstractionResolver; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.Strings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.time.DateFormatter; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.test.OpenSearchTestCase; import java.time.Clock; import java.time.Duration; @@ -52,13 +52,13 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; -import static org.elasticsearch.cluster.DataStreamTestHelper.createTimestampField; +import static org.opensearch.cluster.DataStreamTestHelper.createTimestampField; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.oneOf; import static org.hamcrest.core.IsNull.notNullValue; -public class ResolveIndexTests extends ESTestCase { +public class ResolveIndexTests extends OpenSearchTestCase { private final Object[][] indices = new Object[][] { // name, isClosed, isHidden, isFrozen, dataStream, aliases diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/ConditionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/ConditionTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/admin/indices/rollover/ConditionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/rollover/ConditionTests.java index 2f1a5504d4ac6..6d82322015df5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/ConditionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/ConditionTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.rollover; +package org.opensearch.action.admin.indices.rollover; -import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.opensearch.common.unit.ByteSizeUnit; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.EqualsHashCodeTestUtils; import org.opensearch.action.admin.indices.rollover.Condition; import org.opensearch.action.admin.indices.rollover.MaxAgeCondition; import org.opensearch.action.admin.indices.rollover.MaxDocsCondition; @@ -31,7 +31,7 @@ import static org.hamcrest.Matchers.equalTo; -public class ConditionTests extends ESTestCase { +public class ConditionTests extends OpenSearchTestCase { public void testMaxAge() { final MaxAgeCondition maxAgeCondition = new MaxAgeCondition(TimeValue.timeValueHours(1)); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java index 972943060414a..b293ceb6d7ad7 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java @@ -17,65 +17,65 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.rollover; +package org.opensearch.action.admin.indices.rollover; import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.admin.indices.alias.Alias; import org.opensearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest; import org.opensearch.action.admin.indices.create.CreateIndexRequest; import org.opensearch.action.support.ActiveShardCount; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.DataStreamTestHelper; -import org.elasticsearch.cluster.metadata.AliasAction; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.AliasValidator; -import org.elasticsearch.cluster.metadata.ComponentTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.cluster.metadata.DataStreamTests; -import org.elasticsearch.cluster.metadata.IndexAbstraction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.metadata.MetadataCreateIndexService; -import org.elasticsearch.cluster.metadata.MetadataIndexAliasesService; -import org.elasticsearch.cluster.metadata.Template; -import org.elasticsearch.cluster.routing.allocation.AllocationService; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.CheckedFunction; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.env.Environment; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.mapper.ContentPath; -import org.elasticsearch.index.mapper.DateFieldMapper; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.MappingLookup; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.RoutingFieldMapper; -import org.elasticsearch.index.shard.IndexEventListener; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.indices.InvalidIndexNameException; -import org.elasticsearch.indices.ShardLimitValidator; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.test.ClusterServiceUtils; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.DataStreamTestHelper; +import org.opensearch.cluster.metadata.AliasAction; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.AliasValidator; +import org.opensearch.cluster.metadata.ComponentTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.DataStream; +import org.opensearch.cluster.metadata.DataStreamTests; +import org.opensearch.cluster.metadata.IndexAbstraction; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.IndexTemplateMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.metadata.MetadataCreateIndexService; +import org.opensearch.cluster.metadata.MetadataIndexAliasesService; +import org.opensearch.cluster.metadata.Template; +import org.opensearch.cluster.routing.allocation.AllocationService; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.CheckedFunction; +import org.opensearch.common.Strings; +import org.opensearch.common.UUIDs; +import org.opensearch.common.compress.CompressedXContent; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.env.Environment; +import org.opensearch.index.Index; +import org.opensearch.index.IndexService; +import org.opensearch.index.mapper.ContentPath; +import org.opensearch.index.mapper.DateFieldMapper; +import org.opensearch.index.mapper.DocumentMapper; +import org.opensearch.index.mapper.FieldMapper; +import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.Mapper; +import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.MappingLookup; +import org.opensearch.index.mapper.MetadataFieldMapper; +import org.opensearch.index.mapper.RoutingFieldMapper; +import org.opensearch.index.shard.IndexEventListener; +import org.opensearch.indices.IndicesService; +import org.opensearch.indices.InvalidIndexNameException; +import org.opensearch.indices.ShardLimitValidator; +import org.opensearch.indices.SystemIndices; +import org.opensearch.test.ClusterServiceUtils; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; import org.opensearch.action.admin.indices.rollover.Condition; import org.opensearch.action.admin.indices.rollover.MaxDocsCondition; import org.opensearch.action.admin.indices.rollover.MetadataRolloverService; @@ -91,7 +91,7 @@ import java.util.Map; import static java.util.Collections.emptyMap; -import static org.elasticsearch.cluster.DataStreamTestHelper.generateMapping; +import static org.opensearch.cluster.DataStreamTestHelper.generateMapping; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -110,7 +110,7 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; -public class MetadataRolloverServiceTests extends ESTestCase { +public class MetadataRolloverServiceTests extends OpenSearchTestCase { public void testRolloverAliasActions() { String sourceAlias = randomAlphaOfLength(10); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverRequestTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverRequestTests.java index 96e78d3e2d309..d8aa6a9e2b65e 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverRequestTests.java @@ -17,32 +17,31 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.rollover; +package org.opensearch.action.admin.indices.rollover; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequestTests; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.RandomCreateIndexGenerator; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.indices.IndicesModule; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.XContentTestUtils; -import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; -import org.junit.Before; +import org.opensearch.action.admin.indices.create.CreateIndexRequestTests; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.unit.ByteSizeUnit; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParseException; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.RandomCreateIndexGenerator; +import org.opensearch.index.mapper.MapperService; +import org.opensearch.indices.IndicesModule; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.XContentTestUtils; +import org.opensearch.test.hamcrest.OpenSearchAssertions; import org.opensearch.action.admin.indices.rollover.Condition; import org.opensearch.action.admin.indices.rollover.MaxAgeCondition; import org.opensearch.action.admin.indices.rollover.MaxDocsCondition; @@ -50,16 +49,17 @@ import org.opensearch.action.admin.indices.rollover.RolloverRequest; import java.io.IOException; +import org.junit.Before; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.function.Consumer; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.common.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.Matchers.equalTo; -public class RolloverRequestTests extends ESTestCase { +public class RolloverRequestTests extends OpenSearchTestCase { private NamedWriteableRegistry writeableRegistry; @Override @@ -192,7 +192,7 @@ public void testToAndFromXContent() throws IOException { assertEquals(rolloverRequest.getConditions(), parsedRolloverRequest.getConditions()); BytesReference finalBytes = toShuffledXContent(parsedRolloverRequest, xContentType, EMPTY_PARAMS, humanReadable); - ElasticsearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); + OpenSearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); } public void testUnknownFields() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverResponseTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverResponseTests.java index 16f2fc166c86c..92d128863e8f2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/RolloverResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.rollover; +package org.opensearch.action.admin.indices.rollover; -import org.elasticsearch.Version; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Version; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; +import org.opensearch.test.VersionUtils; import org.opensearch.action.admin.indices.rollover.Condition; import org.opensearch.action.admin.indices.rollover.MaxAgeCondition; import org.opensearch.action.admin.indices.rollover.MaxDocsCondition; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java index 005c8d5a83e14..ddf13d941d456 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java @@ -17,59 +17,59 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.rollover; +package org.opensearch.action.admin.indices.rollover; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRequest; import org.opensearch.action.admin.indices.stats.CommonStats; import org.opensearch.action.admin.indices.stats.IndexStats; import org.opensearch.action.admin.indices.stats.IndicesStatsAction; import org.opensearch.action.admin.indices.stats.IndicesStatsResponse; -import org.elasticsearch.action.admin.indices.stats.IndicesStatsTests; +import org.opensearch.action.admin.indices.stats.IndicesStatsTests; import org.opensearch.action.admin.indices.stats.ShardStats; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.client.Client; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.metadata.MetadataCreateIndexService; -import org.elasticsearch.cluster.metadata.MetadataIndexAliasesService; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.RecoverySource; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.UnassignedInfo; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.index.cache.query.QueryCacheStats; -import org.elasticsearch.index.cache.request.RequestCacheStats; -import org.elasticsearch.index.engine.SegmentsStats; -import org.elasticsearch.index.fielddata.FieldDataStats; -import org.elasticsearch.index.flush.FlushStats; -import org.elasticsearch.index.get.GetStats; -import org.elasticsearch.index.merge.MergeStats; -import org.elasticsearch.index.refresh.RefreshStats; -import org.elasticsearch.index.search.stats.SearchStats; -import org.elasticsearch.index.shard.DocsStats; -import org.elasticsearch.index.shard.IndexingStats; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.shard.ShardPath; -import org.elasticsearch.index.store.StoreStats; -import org.elasticsearch.index.warmer.WarmerStats; -import org.elasticsearch.search.suggest.completion.CompletionStats; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.client.Client; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.metadata.MetadataCreateIndexService; +import org.opensearch.cluster.metadata.MetadataIndexAliasesService; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.RecoverySource; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.UnassignedInfo; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.UUIDs; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.ByteSizeUnit; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.set.Sets; +import org.opensearch.index.cache.query.QueryCacheStats; +import org.opensearch.index.cache.request.RequestCacheStats; +import org.opensearch.index.engine.SegmentsStats; +import org.opensearch.index.fielddata.FieldDataStats; +import org.opensearch.index.flush.FlushStats; +import org.opensearch.index.get.GetStats; +import org.opensearch.index.merge.MergeStats; +import org.opensearch.index.refresh.RefreshStats; +import org.opensearch.index.search.stats.SearchStats; +import org.opensearch.index.shard.DocsStats; +import org.opensearch.index.shard.IndexingStats; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.shard.ShardPath; +import org.opensearch.index.store.StoreStats; +import org.opensearch.index.warmer.WarmerStats; +import org.opensearch.search.suggest.completion.CompletionStats; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.mockito.ArgumentCaptor; import org.opensearch.action.admin.indices.rollover.Condition; import org.opensearch.action.admin.indices.rollover.MaxAgeCondition; @@ -100,7 +100,7 @@ import static org.mockito.Mockito.when; -public class TransportRolloverActionTests extends ESTestCase { +public class TransportRolloverActionTests extends OpenSearchTestCase { public void testDocStatsSelectionFromPrimariesOnly() { long docsInPrimaryShards = 100; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponseTests.java similarity index 76% rename from server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponseTests.java index 1d8bb7c9128c9..1fcec980096ab 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponseTests.java @@ -17,25 +17,25 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.segments; +package org.opensearch.action.admin.indices.segments; import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortField; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.engine.Segment; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.index.engine.Segment; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.segments.IndicesSegmentResponse; import org.opensearch.action.admin.indices.segments.ShardSegments; import java.util.Collections; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; -public class IndicesSegmentResponseTests extends ESTestCase { +public class IndicesSegmentResponseTests extends OpenSearchTestCase { public void testToXContentSerialiationWithSortedFields() throws Exception { ShardRouting shardRouting = TestShardRouting.newShardRouting("foo", 0, "node_id", true, ShardRoutingState.STARTED); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java index ccb258fea278e..91bb00443e7a2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.segments; +package org.opensearch.action.admin.indices.segments; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.engine.Segment; -import org.elasticsearch.index.MergePolicyConfig; -import org.elasticsearch.indices.IndexClosedException; -import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; -import org.elasticsearch.test.InternalSettingsPlugin; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.engine.Segment; +import org.opensearch.index.MergePolicyConfig; +import org.opensearch.indices.IndexClosedException; +import org.opensearch.plugins.Plugin; +import org.opensearch.test.OpenSearchSingleNodeTestCase; +import org.opensearch.test.InternalSettingsPlugin; import org.junit.Before; import org.opensearch.action.admin.indices.segments.IndicesSegmentResponse; import org.opensearch.action.admin.indices.segments.IndicesSegmentsRequest; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java index e352ffd7d5e6c..3cbcc70607e34 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.settings.get; +package org.opensearch.action.admin.indices.settings.get; import org.opensearch.action.ActionListener; import org.opensearch.action.IndicesRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsFilter; -import org.elasticsearch.common.settings.SettingsModule; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.Index; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.SettingsFilter; +import org.opensearch.common.settings.SettingsModule; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.Index; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.Before; import org.opensearch.action.admin.indices.settings.get.GetSettingsRequest; @@ -48,9 +48,9 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptySet; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; -public class GetSettingsActionTests extends ESTestCase { +public class GetSettingsActionTests extends OpenSearchTestCase { private TransportService transportService; private ClusterService clusterService; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestTests.java similarity index 82% rename from server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestTests.java index 0d666706a8a94..15a287f05dc1d 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.settings.get; +package org.opensearch.action.admin.indices.settings.get; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.settings.get.GetSettingsRequest; import java.io.IOException; -public class GetSettingsRequestTests extends ESTestCase { +public class GetSettingsRequestTests extends OpenSearchTestCase { private static final GetSettingsRequest TEST_700_REQUEST = new GetSettingsRequest() .includeDefaults(true) .humanReadable(true) diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponseTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponseTests.java index 6fff22b30b3b4..e86bc441ecc1a 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/get/GetSettingsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.settings.get; +package org.opensearch.action.admin.indices.settings.get; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.IndexScopedSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.RandomCreateIndexGenerator; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.IndexScopedSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.RandomCreateIndexGenerator; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.settings.get.GetSettingsResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java index 054cbd5c0b9a6..4a2fde306a698 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.settings.put; +package org.opensearch.action.admin.indices.settings.put; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.Settings.Builder; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.CollectionUtils; -import org.elasticsearch.test.AbstractWireSerializingTestCase; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.Settings.Builder; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.CollectionUtils; +import org.opensearch.test.AbstractWireSerializingTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest; import java.util.ArrayList; @@ -43,7 +43,7 @@ public class UpdateSettingsRequestSerializationTests extends AbstractWireSeriali protected UpdateSettingsRequest mutateInstance(UpdateSettingsRequest request) { UpdateSettingsRequest mutation = copyRequest(request); List mutators = new ArrayList<>(); - Supplier timeValueSupplier = () -> TimeValue.parseTimeValue(ESTestCase.randomTimeValue(), "_setting"); + Supplier timeValueSupplier = () -> TimeValue.parseTimeValue(OpenSearchTestCase.randomTimeValue(), "_setting"); mutators.add(() -> mutation .masterNodeTimeout(randomValueOtherThan(request.masterNodeTimeout(), timeValueSupplier))); mutators.add(() -> mutation.timeout(randomValueOtherThan(request.timeout(), timeValueSupplier))); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java index 46ba4c1dbff89..5009fb511bb0f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.settings.put; +package org.opensearch.action.admin.indices.settings.put; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java index f3f7c820bef21..962fd1b10e168 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreResponseTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.shards; +package org.opensearch.action.admin.indices.shards; import org.apache.lucene.util.CollectionUtil; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.ImmutableOpenIntMap; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.NodeDisconnectedException; +import org.opensearch.Version; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.common.UUIDs; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.ImmutableOpenIntMap; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.NodeDisconnectedException; import org.opensearch.action.admin.indices.shards.IndicesShardStoresResponse; import java.io.IOException; @@ -45,7 +45,7 @@ import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; -public class IndicesShardStoreResponseTests extends ESTestCase { +public class IndicesShardStoreResponseTests extends OpenSearchTestCase { public void testBasicSerialization() throws Exception { ImmutableOpenMap.Builder>> indexStoreStatuses = ImmutableOpenMap.builder(); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeRequestTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeRequestTests.java index b0a9061dcda83..a4b70b8715849 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeRequestTests.java @@ -17,31 +17,31 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.shrink; +package org.opensearch.action.admin.indices.shrink; import org.opensearch.action.admin.indices.alias.Alias; import org.opensearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequestTests; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.RandomCreateIndexGenerator; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; +import org.opensearch.action.admin.indices.create.CreateIndexRequestTests; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.RandomCreateIndexGenerator; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.hamcrest.OpenSearchAssertions; import org.opensearch.action.admin.indices.shrink.ResizeRequest; import java.io.IOException; import java.util.function.Consumer; import java.util.function.Supplier; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; +import static org.opensearch.common.xcontent.ToXContent.EMPTY_PARAMS; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasToString; -public class ResizeRequestTests extends ESTestCase { +public class ResizeRequestTests extends OpenSearchTestCase { public void testCopySettingsValidation() { runTestCopySettingsValidation(false, r -> { @@ -106,7 +106,7 @@ public void testToAndFromXContent() throws IOException { assertEquals(resizeRequest.getTargetIndexRequest().settings(), parsedResizeRequest.getTargetIndexRequest().settings()); BytesReference finalBytes = toShuffledXContent(parsedResizeRequest, xContentType, EMPTY_PARAMS, humanReadable); - ElasticsearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); + OpenSearchAssertions.assertToXContentEquivalent(originalBytes, finalBytes, xContentType); } private static ResizeRequest createTestItem() { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeResponseTests.java index 4c4fdc73d5813..fc9c75e152e31 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/ResizeResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/ResizeResponseTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.shrink; +package org.opensearch.action.admin.indices.shrink; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.shrink.ResizeResponse; public class ResizeResponseTests extends AbstractSerializingTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/shrink/TransportResizeActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index c0ce35fb008d2..2dc4f10741f4f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -17,32 +17,32 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.shrink; +package org.opensearch.action.admin.indices.shrink; import org.apache.lucene.index.IndexWriter; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.admin.indices.create.CreateIndexClusterStateUpdateRequest; import org.opensearch.action.support.ActiveShardCount; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ESAllocationTestCase; -import org.elasticsearch.cluster.EmptyClusterInfoService; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.allocation.AllocationService; -import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; -import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders; -import org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.shard.DocsStats; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.OpenSearchAllocationTestCase; +import org.opensearch.cluster.EmptyClusterInfoService; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.allocation.AllocationService; +import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; +import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders; +import org.opensearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.shard.DocsStats; import org.opensearch.snapshots.EmptySnapshotsInfoService; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.gateway.TestGatewayAllocator; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.gateway.TestGatewayAllocator; import org.opensearch.action.admin.indices.shrink.ResizeRequest; import org.opensearch.action.admin.indices.shrink.ResizeType; import org.opensearch.action.admin.indices.shrink.TransportResizeAction; @@ -55,7 +55,7 @@ import static java.util.Collections.emptyMap; import static org.hamcrest.Matchers.equalTo; -public class TransportResizeActionTests extends ESTestCase { +public class TransportResizeActionTests extends OpenSearchTestCase { private ClusterState createClusterState(String name, int numShards, int numReplicas, Settings settings) { return createClusterState(name, numShards, numReplicas, numShards, settings); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponseTests.java index 3fa9f7c5b0ffc..f81297a2b4bcc 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponseTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.stats; +package org.opensearch.action.admin.indices.stats; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.shard.ShardPath; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.UUIDs; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.shard.ShardPath; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.admin.indices.stats.IndexStats; import org.opensearch.action.admin.indices.stats.IndicesStatsResponse; import org.opensearch.action.admin.indices.stats.ShardStats; @@ -46,7 +46,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.object.HasToString.hasToString; -public class IndicesStatsResponseTests extends ESTestCase { +public class IndicesStatsResponseTests extends OpenSearchTestCase { public void testInvalidLevel() { final IndicesStatsResponse response = new IndicesStatsResponse(null, 0, 0, 0, null); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java b/server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsTests.java index b5d5e8c5b6df6..c0882e42e8974 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/stats/IndicesStatsTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.stats; +package org.opensearch.action.admin.indices.stats; import org.opensearch.action.ActionFuture; -import org.elasticsearch.action.index.IndexResponse; +import org.opensearch.action.index.IndexResponse; import org.opensearch.action.support.DefaultShardOperationFailedException; import org.opensearch.action.support.WriteRequest.RefreshPolicy; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.IndexModule; -import org.elasticsearch.index.engine.CommitStats; -import org.elasticsearch.index.engine.SegmentsStats; -import org.elasticsearch.index.translog.Translog; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.index.IndexModule; +import org.opensearch.index.engine.CommitStats; +import org.opensearch.index.engine.SegmentsStats; +import org.opensearch.index.translog.Translog; +import org.opensearch.test.OpenSearchSingleNodeTestCase; import org.opensearch.action.admin.indices.stats.CommonStats; import org.opensearch.action.admin.indices.stats.IndicesStatsResponse; import org.opensearch.action.admin.indices.stats.ShardStats; @@ -39,7 +39,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.notNullValue; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java index 1376180367aa2..591518e46f29f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateRequestTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.delete; +package org.opensearch.action.admin.indices.template.delete; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java index b248e549215a9..a13be49315fc5 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateResponseTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.get; +package org.opensearch.action.admin.indices.template.get; -import org.elasticsearch.cluster.metadata.ComponentTemplate; -import org.elasticsearch.cluster.metadata.ComponentTemplateTests; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.ComponentTemplate; +import org.opensearch.cluster.metadata.ComponentTemplateTests; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.template.get.GetComponentTemplateAction; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java index 47a0de781dd15..72e612f342ff6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateRequestTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.get; +package org.opensearch.action.admin.indices.template.get; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java index fb888e35d1c31..99d1089f3aa39 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateResponseTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.get; +package org.opensearch.action.admin.indices.template.get; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplateTests; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java index 77dda4a036994..093a6ad140e45 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponseTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.get; +package org.opensearch.action.admin.indices.template.get; import org.opensearch.action.admin.indices.mapping.get.GetFieldMappingsResponse; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.IndexTemplateMetadata; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java index ca1ee99c4d64d..05f5cea9b674b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequestTests.java @@ -17,18 +17,17 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.post; +package org.opensearch.action.admin.indices.template.post; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.action.admin.indices.template.post.SimulateIndexTemplateRequest; import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests; -import org.elasticsearch.cluster.metadata.Template; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplateTests; +import org.opensearch.cluster.metadata.Template; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java index c5c94a7184402..7456a50fcfbd6 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateRequestTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.post; +package org.opensearch.action.admin.indices.template.post; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.admin.indices.template.post.SimulateTemplateAction; import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests; -import org.elasticsearch.cluster.metadata.Template; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplateTests; +import org.opensearch.cluster.metadata.Template; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java index 784b922ca2741..d9bacb613c220 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateRequestTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.template.put; +package org.opensearch.action.admin.indices.template.put; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests; -import org.elasticsearch.cluster.metadata.Template; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.ComposableIndexTemplateTests; +import org.opensearch.cluster.metadata.Template; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.test.AbstractWireSerializingTestCase; import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import java.io.IOException; @@ -59,7 +59,7 @@ protected PutComposableIndexTemplateAction.Request mutateInstance(PutComposableI public void testPutGlobalTemplatesCannotHaveHiddenIndexSetting() { Template template = new Template(Settings.builder().put(IndexMetadata.SETTING_INDEX_HIDDEN, true).build(), null, null); - ComposableIndexTemplate globalTemplate = new ComposableIndexTemplate(org.elasticsearch.common.collect.List.of("*"), + ComposableIndexTemplate globalTemplate = new ComposableIndexTemplate(org.opensearch.common.collect.List.of("*"), template, null, null, null, null, null); PutComposableIndexTemplateAction.Request request = new PutComposableIndexTemplateAction.Request("test"); diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java b/server/src/test/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java index f9f2a1249964c..a615c7c0f15b2 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestTests.java @@ -16,17 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.admin.indices.template.put; +package org.opensearch.action.admin.indices.template.put; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.admin.indices.alias.Alias; -import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.collect.MapBuilder; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.AbstractXContentTestCase; import org.opensearch.action.admin.indices.template.put.PutIndexTemplateRequest; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/QueryExplanationTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/validate/query/QueryExplanationTests.java index cd94ab82ab566..f7d6dd995e916 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/QueryExplanationTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/QueryExplanationTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.query; +package org.opensearch.action.admin.indices.validate.query; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import org.opensearch.action.admin.indices.validate.query.QueryExplanation; import java.io.IOException; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java index b0b8f20b02155..a54fcbaef800b 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryActionTests.java @@ -17,13 +17,14 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.query; +package org.opensearch.action.admin.indices.validate.query; import org.opensearch.action.ActionListener; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.opensearch.test.OpenSearchSingleNodeTestCase; import org.opensearch.action.admin.indices.validate.query.ValidateQueryRequest; import org.opensearch.action.admin.indices.validate.query.ValidateQueryResponse; + import java.util.concurrent.atomic.AtomicBoolean; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java rename to server/src/test/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java index cbd89f7e815d3..11a4d9010262c 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponseTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.admin.indices.validate.query; +package org.opensearch.action.admin.indices.validate.query; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.support.DefaultShardOperationFailedException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractBroadcastResponseTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractBroadcastResponseTestCase; import org.opensearch.action.admin.indices.validate.query.QueryExplanation; import org.opensearch.action.admin.indices.validate.query.ValidateQueryResponse; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BackoffPolicyTests.java b/server/src/test/java/org/opensearch/action/bulk/BackoffPolicyTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/bulk/BackoffPolicyTests.java rename to server/src/test/java/org/opensearch/action/bulk/BackoffPolicyTests.java index c84bbe0014fde..a5454b242858e 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BackoffPolicyTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BackoffPolicyTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.bulk.BackoffPolicy; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.atomic.AtomicInteger; -import static org.elasticsearch.common.unit.TimeValue.timeValueMillis; +import static org.opensearch.common.unit.TimeValue.timeValueMillis; -public class BackoffPolicyTests extends ESTestCase { +public class BackoffPolicyTests extends OpenSearchTestCase { public void testWrapBackoffPolicy() { TimeValue timeValue = timeValueMillis(between(0, Integer.MAX_VALUE)); int maxNumberOfRetries = between(1, 1000); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkItemResponseTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkItemResponseTests.java index a880377fba81a..254834ee03caf 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkItemResponseTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkItemResponseTests.java @@ -17,32 +17,32 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ExceptionsHelper; +import org.opensearch.OpenSearchException; +import org.opensearch.ExceptionsHelper; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkItemResponse.Failure; -import org.elasticsearch.action.delete.DeleteResponseTests; -import org.elasticsearch.action.index.IndexResponseTests; -import org.elasticsearch.action.update.UpdateResponse; -import org.elasticsearch.action.update.UpdateResponseTests; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.delete.DeleteResponseTests; +import org.opensearch.action.index.IndexResponseTests; +import org.opensearch.action.update.UpdateResponse; +import org.opensearch.action.update.UpdateResponseTests; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; -import static org.elasticsearch.ElasticsearchExceptionTests.assertDeepEquals; -import static org.elasticsearch.ElasticsearchExceptionTests.randomExceptions; +import static org.opensearch.OpenSearchExceptionTests.assertDeepEquals; +import static org.opensearch.OpenSearchExceptionTests.randomExceptions; import static org.hamcrest.Matchers.containsString; -public class BulkItemResponseTests extends ESTestCase { +public class BulkItemResponseTests extends OpenSearchTestCase { public void testFailureToString() { Failure failure = new Failure("index", "type", "id", new RuntimeException("test")); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkPrimaryExecutionContextTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkPrimaryExecutionContextTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkPrimaryExecutionContextTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkPrimaryExecutionContextTests.java index df72cab518617..22cb4021b376e 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkPrimaryExecutionContextTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkPrimaryExecutionContextTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.DocWriteRequest; -import org.elasticsearch.action.bulk.TransportShardBulkActionTests.FakeDeleteResult; -import org.elasticsearch.action.bulk.TransportShardBulkActionTests.FakeIndexResult; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.index.IndexRequest; +import org.opensearch.action.bulk.TransportShardBulkActionTests.FakeDeleteResult; +import org.opensearch.action.bulk.TransportShardBulkActionTests.FakeIndexResult; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.WriteRequest; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.index.engine.Engine; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.translog.Translog; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.index.engine.Engine; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.translog.Translog; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.bulk.BulkItemRequest; import org.opensearch.action.bulk.BulkPrimaryExecutionContext; import org.opensearch.action.bulk.BulkShardRequest; @@ -42,7 +42,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class BulkPrimaryExecutionContextTests extends ESTestCase { +public class BulkPrimaryExecutionContextTests extends OpenSearchTestCase { public void testAbortedSkipped() { BulkShardRequest shardRequest = generateRandomRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkProcessorTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkProcessorTests.java index ea5cf30dc386a..ea6cfd9cb61e0 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkProcessorTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkProcessorTests.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.ExceptionsHelper; +import org.opensearch.ExceptionsHelper; import org.opensearch.action.ActionListener; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.unit.ByteSizeUnit; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.Scheduler; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.unit.ByteSizeUnit; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.Scheduler; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; import org.opensearch.action.bulk.BackoffPolicy; @@ -57,7 +57,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; -public class BulkProcessorTests extends ESTestCase { +public class BulkProcessorTests extends OpenSearchTestCase { private ThreadPool threadPool; private final Logger logger = LogManager.getLogger(BulkProcessorTests.class); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkRequestModifierTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkRequestModifierTests.java index 05e99c7ed209a..c85c00941366e 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestModifierTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkRequestModifierTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; import org.opensearch.action.ActionListener; import org.opensearch.action.DocWriteRequest; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.action.index.IndexResponse; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; import org.hamcrest.Matchers; import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkRequest; @@ -43,7 +43,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.mockito.Mockito.mock; -public class BulkRequestModifierTests extends ESTestCase { +public class BulkRequestModifierTests extends OpenSearchTestCase { public void testBulkRequestModifier() { int numRequests = scaledRandomIntBetween(8, 64); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkRequestParserTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkRequestParserTests.java index 897fe26e6aa86..6eca92dde90d4 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestParserTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkRequestParserTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.xcontent.XContentType; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.action.document.RestBulkAction; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.hamcrest.Matchers; import org.opensearch.action.bulk.BulkRequestParser; @@ -32,7 +32,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -public class BulkRequestParserTests extends ESTestCase { +public class BulkRequestParserTests extends OpenSearchTestCase { public void testIndexRequest() throws IOException { BytesArray request = new BytesArray("{ \"index\":{ \"_id\": \"bar\" } }\n{}\n"); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkRequestTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkRequestTests.java index ee4f022196bbc..5ff681783d04f 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkRequestTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkRequestTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.DocWriteRequest; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.index.IndexRequest; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.WriteRequest.RefreshPolicy; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.client.Requests; -import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.client.Requests; +import org.opensearch.common.ParsingException; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.action.document.RestBulkAction; -import org.elasticsearch.script.Script; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.script.Script; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.bulk.BulkRequest; import java.io.IOException; @@ -46,7 +46,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; +import static org.opensearch.test.StreamsUtils.copyToStringFromClasspath; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; -public class BulkRequestTests extends ESTestCase { +public class BulkRequestTests extends OpenSearchTestCase { public void testSimpleBulk1() throws Exception { String bulkAction = copyToStringFromClasspath("/org/opensearch/action/bulk/simple-bulk.json"); BulkRequest bulkRequest = new BulkRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkResponseTests.java similarity index 82% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkResponseTests.java index 3e426ddda6855..6efd2a4cfd621 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkResponseTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkResponseTests.java @@ -17,33 +17,33 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ExceptionsHelper; +import org.opensearch.OpenSearchException; +import org.opensearch.ExceptionsHelper; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.DocWriteResponse; -import org.elasticsearch.action.delete.DeleteResponseTests; -import org.elasticsearch.action.index.IndexResponseTests; -import org.elasticsearch.action.update.UpdateResponseTests; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.action.delete.DeleteResponseTests; +import org.opensearch.action.index.IndexResponseTests; +import org.opensearch.action.update.UpdateResponseTests; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkResponse; import java.io.IOException; -import static org.elasticsearch.ElasticsearchExceptionTests.randomExceptions; -import static org.elasticsearch.action.bulk.BulkItemResponseTests.assertBulkItemResponse; +import static org.opensearch.OpenSearchExceptionTests.randomExceptions; +import static org.opensearch.action.bulk.BulkItemResponseTests.assertBulkItemResponse; import static org.opensearch.action.bulk.BulkResponse.NO_INGEST_TOOK; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; -public class BulkResponseTests extends ESTestCase { +public class BulkResponseTests extends OpenSearchTestCase { public void testToAndFromXContent() throws IOException { XContentType xContentType = randomFrom(XContentType.values()); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/BulkShardRequestTests.java b/server/src/test/java/org/opensearch/action/bulk/BulkShardRequestTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/bulk/BulkShardRequestTests.java rename to server/src/test/java/org/opensearch/action/bulk/BulkShardRequestTests.java index 2c9002e98cc9f..257a6e7d11daf 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/BulkShardRequestTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/BulkShardRequestTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; import org.opensearch.action.support.WriteRequest.RefreshPolicy; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.bulk.BulkItemRequest; import org.opensearch.action.bulk.BulkShardRequest; import static org.apache.lucene.util.TestUtil.randomSimpleString; -public class BulkShardRequestTests extends ESTestCase { +public class BulkShardRequestTests extends OpenSearchTestCase { public void testToString() { String index = randomSimpleString(random(), 10); int count = between(2, 100); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/RetryTests.java b/server/src/test/java/org/opensearch/action/bulk/RetryTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/bulk/RetryTests.java rename to server/src/test/java/org/opensearch/action/bulk/RetryTests.java index 1cafdf1b21cbc..52db269d36ed8 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/RetryTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/RetryTests.java @@ -16,19 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.bulk; + +package org.opensearch.action.bulk; import org.opensearch.action.ActionFuture; import org.opensearch.action.ActionListener; import org.opensearch.action.DocWriteRequest.OpType; -import org.elasticsearch.action.delete.DeleteResponse; +import org.opensearch.action.delete.DeleteResponse; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.client.NoOpClient; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.client.NoOpClient; import org.junit.After; import org.junit.Before; import org.opensearch.action.bulk.BackoffPolicy; @@ -46,7 +47,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class RetryTests extends ESTestCase { +public class RetryTests extends OpenSearchTestCase { // no need to wait fof a long time in tests private static final TimeValue DELAY = TimeValue.timeValueMillis(1L); private static final int CALLS_TO_FAIL = 5; diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java rename to server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java index ee5b72fd18014..305316703397e 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java @@ -17,33 +17,33 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.index.IndexRequest; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.index.VersionType; +import org.opensearch.index.IndexingPressure; +import org.opensearch.indices.SystemIndices; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkRequest; import org.opensearch.action.bulk.BulkResponse; @@ -63,7 +63,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class TransportBulkActionIndicesThatCannotBeCreatedTests extends ESTestCase { +public class TransportBulkActionIndicesThatCannotBeCreatedTests extends OpenSearchTestCase { public void testNonExceptional() { BulkRequest bulkRequest = new BulkRequest(); bulkRequest.add(new IndexRequest(randomAlphaOfLength(5))); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIngestTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIngestTests.java rename to server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java index c6054c788d5dc..a2970985badc4 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionIngestTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java @@ -17,53 +17,53 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.index.IndexAction; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.action.index.IndexResponse; +import org.opensearch.action.index.IndexAction; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.action.index.IndexResponse; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.AutoCreateIndex; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.cluster.ClusterChangedEvent; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ClusterStateApplier; -import org.elasticsearch.cluster.metadata.AliasMetadata; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.IndexTemplateMetadata; -import org.elasticsearch.cluster.metadata.ComposableIndexTemplate; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.metadata.Template; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.collect.ImmutableOpenMap; -import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.ingest.IngestService; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.threadpool.ThreadPool.Names; -import org.elasticsearch.transport.TransportResponseHandler; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.cluster.ClusterChangedEvent; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.ClusterStateApplier; +import org.opensearch.cluster.metadata.AliasMetadata; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.IndexTemplateMetadata; +import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.metadata.Template; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Nullable; +import org.opensearch.common.collect.ImmutableOpenMap; +import org.opensearch.common.collect.MapBuilder; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.index.IndexSettings; +import org.opensearch.index.IndexingPressure; +import org.opensearch.indices.SystemIndices; +import org.opensearch.ingest.IngestService; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.threadpool.ThreadPool.Names; +import org.opensearch.transport.TransportResponseHandler; +import org.opensearch.transport.TransportService; import org.junit.Before; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -98,7 +98,7 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; -public class TransportBulkActionIngestTests extends ESTestCase { +public class TransportBulkActionIngestTests extends OpenSearchTestCase { /** * Index for which mock settings contain a default pipeline. diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java rename to server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java index aee4b5817d562..5e710ae27243b 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTests.java @@ -17,44 +17,44 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.ResourceAlreadyExistsException; -import org.elasticsearch.Version; +import org.opensearch.ResourceAlreadyExistsException; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.bulk.TransportBulkActionTookTests.Resolver; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.index.IndexRequest; +import org.opensearch.action.bulk.TransportBulkActionTookTests.Resolver; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.AutoCreateIndex; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.DataStream; -import org.elasticsearch.cluster.metadata.IndexAbstraction; -import org.elasticsearch.cluster.metadata.IndexAbstraction.Index; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.indices.SystemIndexDescriptor; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.DataStream; +import org.opensearch.cluster.metadata.IndexAbstraction; +import org.opensearch.cluster.metadata.IndexAbstraction.Index; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.index.IndexingPressure; +import org.opensearch.index.VersionType; +import org.opensearch.indices.SystemIndexDescriptor; +import org.opensearch.indices.SystemIndices; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.Before; import org.opensearch.action.bulk.BulkItemResponse; @@ -73,12 +73,12 @@ import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; import static org.opensearch.action.bulk.TransportBulkAction.prohibitCustomRoutingOnDataStream; -import static org.elasticsearch.cluster.metadata.MetadataCreateDataStreamServiceTests.createDataStream; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.cluster.metadata.MetadataCreateDataStreamServiceTests.createDataStream; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class TransportBulkActionTests extends ESTestCase { +public class TransportBulkActionTests extends OpenSearchTestCase { /** Services needed by bulk action */ private TransportService transportService; @@ -119,7 +119,7 @@ void createIndex(String index, TimeValue timeout, Version minNodeVersion, Action public void setUp() throws Exception { super.setUp(); threadPool = new TestThreadPool(getClass().getName()); - DiscoveryNode discoveryNode = new DiscoveryNode("node", ESTestCase.buildNewFakeTransportAddress(), emptyMap(), + DiscoveryNode discoveryNode = new DiscoveryNode("node", OpenSearchTestCase.buildNewFakeTransportAddress(), emptyMap(), DiscoveryNodeRole.BUILT_IN_ROLES, VersionUtils.randomCompatibleVersion(random(), Version.CURRENT)); clusterService = createClusterService(threadPool, discoveryNode); CapturingTransport capturingTransport = new CapturingTransport(); @@ -289,18 +289,18 @@ public void testIncludesSystem() { new Index(IndexMetadata.builder(".foo").settings(settings).system(true).numberOfShards(1).numberOfReplicas(0).build())); indicesLookup.put(".bar", new Index(IndexMetadata.builder(".bar").settings(settings).system(true).numberOfShards(1).numberOfReplicas(0).build())); - SystemIndices systemIndices = new SystemIndices(org.elasticsearch.common.collect.Map.of("plugin", - org.elasticsearch.common.collect.List.of(new SystemIndexDescriptor(".test", "")))); - List onlySystem = org.elasticsearch.common.collect.List.of(".foo", ".bar"); + SystemIndices systemIndices = new SystemIndices(org.opensearch.common.collect.Map.of("plugin", + org.opensearch.common.collect.List.of(new SystemIndexDescriptor(".test", "")))); + List onlySystem = org.opensearch.common.collect.List.of(".foo", ".bar"); assertTrue(bulkAction.includesSystem(buildBulkRequest(onlySystem), indicesLookup, systemIndices)); - onlySystem = org.elasticsearch.common.collect.List.of(".foo", ".bar", ".test"); + onlySystem = org.opensearch.common.collect.List.of(".foo", ".bar", ".test"); assertTrue(bulkAction.includesSystem(buildBulkRequest(onlySystem), indicesLookup, systemIndices)); - List nonSystem = org.elasticsearch.common.collect.List.of("foo", "bar"); + List nonSystem = org.opensearch.common.collect.List.of("foo", "bar"); assertFalse(bulkAction.includesSystem(buildBulkRequest(nonSystem), indicesLookup, systemIndices)); - List mixed = org.elasticsearch.common.collect.List.of(".foo", ".test", "other"); + List mixed = org.opensearch.common.collect.List.of(".foo", ".test", "other"); assertTrue(bulkAction.includesSystem(buildBulkRequest(mixed), indicesLookup, systemIndices)); } diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTookTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java rename to server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTookTests.java index 1f7b6040e8994..a86032458f579 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportBulkActionTookTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionTookTests.java @@ -18,11 +18,11 @@ */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; import org.apache.lucene.util.Constants; import org.opensearch.action.ActionType; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionResponse; @@ -30,28 +30,28 @@ import org.opensearch.action.admin.indices.create.CreateIndexResponse; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.AutoCreateIndex; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.IndexNotFoundException; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Strings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.IndexNotFoundException; import org.opensearch.rest.action.document.RestBulkAction; -import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.index.IndexingPressure; +import org.opensearch.indices.SystemIndices; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -71,12 +71,12 @@ import java.util.function.LongSupplier; import static java.util.Collections.emptyMap; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.StreamsUtils.copyToStringFromClasspath; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; -public class TransportBulkActionTookTests extends ESTestCase { +public class TransportBulkActionTookTests extends OpenSearchTestCase { private static ThreadPool threadPool; private ClusterService clusterService; @@ -95,7 +95,7 @@ public static void afterClass() { @Before public void setUp() throws Exception { super.setUp(); - DiscoveryNode discoveryNode = new DiscoveryNode("node", ESTestCase.buildNewFakeTransportAddress(), emptyMap(), + DiscoveryNode discoveryNode = new DiscoveryNode("node", OpenSearchTestCase.buildNewFakeTransportAddress(), emptyMap(), DiscoveryNodeRole.BUILT_IN_ROLES, VersionUtils.randomCompatibleVersion(random(), Version.CURRENT)); clusterService = createClusterService(threadPool, discoveryNode); } diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportShardBulkActionTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/bulk/TransportShardBulkActionTests.java rename to server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java index fc78b2f3fb90a..478b37a2bd2db 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportShardBulkActionTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportShardBulkActionTests.java @@ -17,46 +17,46 @@ * under the License. */ -package org.elasticsearch.action.bulk; +package org.opensearch.action.bulk; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.OpenSearchStatusException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchException; +import org.opensearch.OpenSearchStatusException; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.LatchedActionListener; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.delete.DeleteResponse; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.action.index.IndexResponse; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.delete.DeleteResponse; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.action.index.IndexResponse; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.WriteRequest.RefreshPolicy; -import org.elasticsearch.action.support.replication.TransportWriteAction.WritePrimaryResult; -import org.elasticsearch.action.update.UpdateHelper; -import org.elasticsearch.action.update.UpdateRequest; -import org.elasticsearch.action.update.UpdateResponse; -import org.elasticsearch.client.Requests; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.lucene.uid.Versions; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.engine.Engine; -import org.elasticsearch.index.engine.VersionConflictEngineException; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.Mapping; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.RootObjectMapper; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.IndexShardTestCase; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.translog.Translog; +import org.opensearch.action.support.replication.TransportWriteAction.WritePrimaryResult; +import org.opensearch.action.update.UpdateHelper; +import org.opensearch.action.update.UpdateRequest; +import org.opensearch.action.update.UpdateResponse; +import org.opensearch.client.Requests; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.lucene.uid.Versions; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.index.IndexSettings; +import org.opensearch.index.VersionType; +import org.opensearch.index.engine.Engine; +import org.opensearch.index.engine.VersionConflictEngineException; +import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.Mapping; +import org.opensearch.index.mapper.MetadataFieldMapper; +import org.opensearch.index.mapper.RootObjectMapper; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.translog.Translog; import org.opensearch.rest.RestStatus; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.threadpool.ThreadPool.Names; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.action.bulk.BulkItemRequest; import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkPrimaryExecutionContext; diff --git a/server/src/test/java/org/elasticsearch/action/delete/DeleteRequestTests.java b/server/src/test/java/org/opensearch/action/delete/DeleteRequestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/delete/DeleteRequestTests.java rename to server/src/test/java/org/opensearch/action/delete/DeleteRequestTests.java index a46f92cd620fd..8518f30f1b739 100644 --- a/server/src/test/java/org/elasticsearch/action/delete/DeleteRequestTests.java +++ b/server/src/test/java/org/opensearch/action/delete/DeleteRequestTests.java @@ -16,16 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.delete; +package org.opensearch.action.delete; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; -public class DeleteRequestTests extends ESTestCase { +public class DeleteRequestTests extends OpenSearchTestCase { public void testValidation() { { diff --git a/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java b/server/src/test/java/org/opensearch/action/delete/DeleteResponseTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java rename to server/src/test/java/org/opensearch/action/delete/DeleteResponseTests.java index 02ef8c27c0250..1b7a9ad254d8e 100644 --- a/server/src/test/java/org/elasticsearch/action/delete/DeleteResponseTests.java +++ b/server/src/test/java/org/opensearch/action/delete/DeleteResponseTests.java @@ -17,28 +17,28 @@ * under the License. */ -package org.elasticsearch.action.delete; - -import org.elasticsearch.action.support.replication.ReplicationResponse; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.seqno.SequenceNumbers; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.RandomObjects; +package org.opensearch.action.delete; + +import org.opensearch.action.support.replication.ReplicationResponse; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.seqno.SequenceNumbers; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.function.Predicate; -import static org.elasticsearch.action.index.IndexResponseTests.assertDocWriteResponse; -import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.action.index.IndexResponseTests.assertDocWriteResponse; +import static org.opensearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; -public class DeleteResponseTests extends ESTestCase { +public class DeleteResponseTests extends OpenSearchTestCase { public void testToXContent() { { diff --git a/server/src/test/java/org/elasticsearch/action/explain/ExplainRequestTests.java b/server/src/test/java/org/opensearch/action/explain/ExplainRequestTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/explain/ExplainRequestTests.java rename to server/src/test/java/org/opensearch/action/explain/ExplainRequestTests.java index e972e8d30f7f6..ffdfa16a58c78 100644 --- a/server/src/test/java/org/elasticsearch/action/explain/ExplainRequestTests.java +++ b/server/src/test/java/org/opensearch/action/explain/ExplainRequestTests.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.explain; +package org.opensearch.action.explain; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.indices.IndicesModule; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.indices.IndicesModule; +import org.opensearch.search.SearchModule; +import org.opensearch.search.fetch.subphase.FetchSourceContext; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.ArrayList; @@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; -public class ExplainRequestTests extends ESTestCase { +public class ExplainRequestTests extends OpenSearchTestCase { private NamedWriteableRegistry namedWriteableRegistry; public void setUp() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java b/server/src/test/java/org/opensearch/action/explain/ExplainResponseTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java rename to server/src/test/java/org/opensearch/action/explain/ExplainResponseTests.java index 1b3b9a8afa9f4..feb1c80883b53 100644 --- a/server/src/test/java/org/elasticsearch/action/explain/ExplainResponseTests.java +++ b/server/src/test/java/org/opensearch/action/explain/ExplainResponseTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.explain; +package org.opensearch.action.explain; import org.apache.lucene.search.Explanation; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.document.DocumentField; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.get.GetResult; +import org.opensearch.test.AbstractSerializingTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java rename to server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestTests.java index 16e9e86b9800d..eb12df85938ff 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java +++ b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.fieldcaps; +package org.opensearch.action.fieldcaps; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.util.ArrayUtils; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponseTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java rename to server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponseTests.java index a6cca030337f8..7ffd0565ac525 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesResponseTests.java +++ b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponseTests.java @@ -17,10 +17,10 @@ * under the License. */ -package org.elasticsearch.action.fieldcaps; +package org.opensearch.action.fieldcaps; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.AbstractWireSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.AbstractWireSerializingTestCase; import java.util.ArrayList; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesTests.java similarity index 98% rename from server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java rename to server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesTests.java index 5fb21bca3f341..20ec94e1ad2c8 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesTests.java +++ b/server/src/test/java/org/opensearch/action/fieldcaps/FieldCapabilitiesTests.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.fieldcaps; +package org.opensearch.action.fieldcaps; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.Arrays; diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java b/server/src/test/java/org/opensearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java rename to server/src/test/java/org/opensearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java index b98e9445fb9bb..8d6c223c69b8e 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java +++ b/server/src/test/java/org/opensearch/action/fieldcaps/MergedFieldCapabilitiesResponseTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.fieldcaps; - -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.AbstractSerializingTestCase; +package org.opensearch.action.fieldcaps; + +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.util.Collections; diff --git a/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java b/server/src/test/java/org/opensearch/action/get/GetRequestTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java rename to server/src/test/java/org/opensearch/action/get/GetRequestTests.java index c4adfbcce393c..e1b82383731e5 100644 --- a/server/src/test/java/org/elasticsearch/action/get/GetRequestTests.java +++ b/server/src/test/java/org/opensearch/action/get/GetRequestTests.java @@ -16,16 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.get; +package org.opensearch.action.get; import org.opensearch.action.ActionRequestValidationException; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; -public class GetRequestTests extends ESTestCase { +public class GetRequestTests extends OpenSearchTestCase { public void testValidation() { { diff --git a/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java b/server/src/test/java/org/opensearch/action/get/GetResponseTests.java similarity index 83% rename from server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java rename to server/src/test/java/org/opensearch/action/get/GetResponseTests.java index 359a394b33806..96a1490a6da67 100644 --- a/server/src/test/java/org/elasticsearch/action/get/GetResponseTests.java +++ b/server/src/test/java/org/opensearch/action/get/GetResponseTests.java @@ -17,34 +17,34 @@ * under the License. */ -package org.elasticsearch.action.get; - -import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.get; + +import org.opensearch.common.ParsingException; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.document.DocumentField; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.get.GetResult; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.Collections; import java.util.function.Predicate; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.index.get.GetResultTests.copyGetResult; -import static org.elasticsearch.index.get.GetResultTests.mutateGetResult; -import static org.elasticsearch.index.get.GetResultTests.randomGetResult; -import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; -import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.index.get.GetResultTests.copyGetResult; +import static org.opensearch.index.get.GetResultTests.mutateGetResult; +import static org.opensearch.index.get.GetResultTests.randomGetResult; +import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +import static org.opensearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; -public class GetResponseTests extends ESTestCase { +public class GetResponseTests extends OpenSearchTestCase { public void testToAndFromXContent() throws Exception { doFromXContentTestWithRandomFields(false); diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java b/server/src/test/java/org/opensearch/action/get/MultiGetRequestTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java rename to server/src/test/java/org/opensearch/action/get/MultiGetRequestTests.java index fd2a1e5dca8e4..d3ade269419ab 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetRequestTests.java +++ b/server/src/test/java/org/opensearch/action/get/MultiGetRequestTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.get; +package org.opensearch.action.get; -import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.ParsingException; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.VersionType; +import org.opensearch.search.fetch.subphase.FetchSourceContext; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class MultiGetRequestTests extends ESTestCase { +public class MultiGetRequestTests extends OpenSearchTestCase { public void testAddWithInvalidKey() throws IOException { final XContentBuilder builder = XContentFactory.jsonBuilder(); diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java b/server/src/test/java/org/opensearch/action/get/MultiGetResponseTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java rename to server/src/test/java/org/opensearch/action/get/MultiGetResponseTests.java index 8182e49049052..7edb7e2bb5d73 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetResponseTests.java +++ b/server/src/test/java/org/opensearch/action/get/MultiGetResponseTests.java @@ -16,15 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.get; +package org.opensearch.action.get; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.get.GetResult; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; @@ -32,7 +32,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -public class MultiGetResponseTests extends ESTestCase { +public class MultiGetResponseTests extends OpenSearchTestCase { public void testFromXContent() throws IOException { for (int runs = 0; runs < 20; runs++) { diff --git a/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java b/server/src/test/java/org/opensearch/action/get/MultiGetShardRequestTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java rename to server/src/test/java/org/opensearch/action/get/MultiGetShardRequestTests.java index 4d43454e8dd25..33440777ef36a 100644 --- a/server/src/test/java/org/elasticsearch/action/get/MultiGetShardRequestTests.java +++ b/server/src/test/java/org/opensearch/action/get/MultiGetShardRequestTests.java @@ -17,20 +17,20 @@ * under the License. */ -package org.elasticsearch.action.get; +package org.opensearch.action.get; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.search.fetch.subphase.FetchSourceContext; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.index.VersionType; +import org.opensearch.search.fetch.subphase.FetchSourceContext; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; -import static org.elasticsearch.test.VersionUtils.randomVersion; +import static org.opensearch.test.VersionUtils.randomVersion; import static org.hamcrest.CoreMatchers.equalTo; -public class MultiGetShardRequestTests extends ESTestCase { +public class MultiGetShardRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { MultiGetRequest multiGetRequest = new MultiGetRequest(); if (randomBoolean()) { diff --git a/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java b/server/src/test/java/org/opensearch/action/get/TransportMultiGetActionTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java rename to server/src/test/java/org/opensearch/action/get/TransportMultiGetActionTests.java index 06194078d807a..a7d47d093bc45 100644 --- a/server/src/test/java/org/elasticsearch/action/get/TransportMultiGetActionTests.java +++ b/server/src/test/java/org/opensearch/action/get/TransportMultiGetActionTests.java @@ -17,41 +17,41 @@ * under the License. */ -package org.elasticsearch.action.get; +package org.opensearch.action.get; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.IndicesRequest; import org.opensearch.action.RoutingMissingException; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.OperationRouting; -import org.elasticsearch.cluster.routing.ShardIterator; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportService; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.OperationRouting; +import org.opensearch.cluster.routing.ShardIterator; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.IndicesService; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskId; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportService; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -61,7 +61,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.common.UUIDs.randomBase64UUID; +import static org.opensearch.common.UUIDs.randomBase64UUID; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.Matchers.anyString; @@ -69,7 +69,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class TransportMultiGetActionTests extends ESTestCase { +public class TransportMultiGetActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; private static TransportService transportService; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java b/server/src/test/java/org/opensearch/action/index/IndexRequestBuilderTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java rename to server/src/test/java/org/opensearch/action/index/IndexRequestBuilderTests.java index 5341588f7226b..6f76f8ce54d39 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexRequestBuilderTests.java +++ b/server/src/test/java/org/opensearch/action/index/IndexRequestBuilderTests.java @@ -17,14 +17,14 @@ * under the License. */ -package org.elasticsearch.action.index; +package org.opensearch.action.index; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.client.NoOpClient; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.client.NoOpClient; import org.junit.After; import org.junit.Before; @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.Map; -public class IndexRequestBuilderTests extends ESTestCase { +public class IndexRequestBuilderTests extends OpenSearchTestCase { private static final String EXPECTED_SOURCE = "{\"SomeKey\":\"SomeValue\"}"; private NoOpClient testClient; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java b/server/src/test/java/org/opensearch/action/index/IndexRequestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java rename to server/src/test/java/org/opensearch/action/index/IndexRequestTests.java index 79367ca602c4f..e372cad565363 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexRequestTests.java +++ b/server/src/test/java/org/opensearch/action/index/IndexRequestTests.java @@ -16,23 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.index; +package org.opensearch.action.index; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.DocWriteRequest; import org.opensearch.action.support.ActiveShardCount; -import org.elasticsearch.action.support.replication.ReplicationResponse; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.seqno.SequenceNumbers; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.action.support.replication.ReplicationResponse; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.unit.ByteSizeValue; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.VersionType; +import org.opensearch.index.seqno.SequenceNumbers; +import org.opensearch.index.shard.ShardId; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -46,7 +46,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; -public class IndexRequestTests extends ESTestCase { +public class IndexRequestTests extends OpenSearchTestCase { public void testIndexRequestOpTypeFromString() throws Exception { String create = "create"; String index = "index"; diff --git a/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java b/server/src/test/java/org/opensearch/action/index/IndexResponseTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java rename to server/src/test/java/org/opensearch/action/index/IndexResponseTests.java index 4b5adf68d36fd..04b3a31a05e39 100644 --- a/server/src/test/java/org/elasticsearch/action/index/IndexResponseTests.java +++ b/server/src/test/java/org/opensearch/action/index/IndexResponseTests.java @@ -17,29 +17,29 @@ * under the License. */ -package org.elasticsearch.action.index; +package org.opensearch.action.index; import org.opensearch.action.DocWriteResponse; -import org.elasticsearch.action.support.replication.ReplicationResponse; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.seqno.SequenceNumbers; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.action.support.replication.ReplicationResponse; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.seqno.SequenceNumbers; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.function.Predicate; -import static org.elasticsearch.action.support.replication.ReplicationResponseTests.assertShardInfo; -import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.action.support.replication.ReplicationResponseTests.assertShardInfo; +import static org.opensearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; -public class IndexResponseTests extends ESTestCase { +public class IndexResponseTests extends OpenSearchTestCase { public void testToXContent() { { diff --git a/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java b/server/src/test/java/org/opensearch/action/ingest/GetPipelineResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java rename to server/src/test/java/org/opensearch/action/ingest/GetPipelineResponseTests.java index 48d4d09400bf7..2d4dd8eaff3d8 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/GetPipelineResponseTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/GetPipelineResponseTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.ingest.PipelineConfiguration; -import org.elasticsearch.test.AbstractSerializingTestCase; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.LoggingDeprecationHandler; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.ingest.PipelineConfiguration; +import org.opensearch.test.AbstractSerializingTestCase; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java b/server/src/test/java/org/opensearch/action/ingest/PutPipelineRequestTests.java similarity index 82% rename from server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java rename to server/src/test/java/org/opensearch/action/ingest/PutPipelineRequestTests.java index a86ba97ebf5f1..c932d5ec2ec45 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/PutPipelineRequestTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.ingest.Pipeline; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.ingest.Pipeline; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.nio.charset.StandardCharsets; -public class PutPipelineRequestTests extends ESTestCase { +public class PutPipelineRequestTests extends OpenSearchTestCase { public void testSerializationWithXContent() throws IOException { PutPipelineRequest request = new PutPipelineRequest("1", new BytesArray("{}".getBytes(StandardCharsets.UTF_8)), XContentType.JSON); diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulateDocumentBaseResultTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulateDocumentBaseResultTests.java index bfa6c1eb9b8c3..e4a2d649c8713 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentBaseResultTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulateDocumentBaseResultTests.java @@ -17,24 +17,24 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.ingest.IngestDocument; +import org.opensearch.test.AbstractXContentTestCase; import java.io.IOException; import java.util.StringJoiner; import java.util.function.Predicate; import java.util.function.Supplier; -import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; +import static org.opensearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.elasticsearch.action.ingest.WriteableIngestDocumentTests.createRandomIngestDoc; +import static org.opensearch.action.ingest.WriteableIngestDocumentTests.createRandomIngestDoc; public class SimulateDocumentBaseResultTests extends AbstractXContentTestCase { diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulateDocumentVerboseResultTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulateDocumentVerboseResultTests.java index b796a997d55fc..7da935b59fdf5 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateDocumentVerboseResultTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulateDocumentVerboseResultTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import java.io.IOException; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulateExecutionServiceTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulateExecutionServiceTests.java index ea0cbc951bb07..1ca93345e6be8 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulateExecutionServiceTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; import org.opensearch.action.ActionListener; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.ingest.AbstractProcessor; -import org.elasticsearch.ingest.CompoundProcessor; -import org.elasticsearch.ingest.DropProcessor; -import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.ingest.IngestProcessorException; -import org.elasticsearch.ingest.Pipeline; -import org.elasticsearch.ingest.Processor; -import org.elasticsearch.ingest.RandomDocumentPicks; -import org.elasticsearch.ingest.TestProcessor; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.index.VersionType; +import org.opensearch.ingest.AbstractProcessor; +import org.opensearch.ingest.CompoundProcessor; +import org.opensearch.ingest.DropProcessor; +import org.opensearch.ingest.IngestDocument; +import org.opensearch.ingest.IngestProcessorException; +import org.opensearch.ingest.Pipeline; +import org.opensearch.ingest.Processor; +import org.opensearch.ingest.RandomDocumentPicks; +import org.opensearch.ingest.TestProcessor; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; @@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; -import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; +import static org.opensearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.sameInstance; -public class SimulateExecutionServiceTests extends ESTestCase { +public class SimulateExecutionServiceTests extends OpenSearchTestCase { private final Integer version = randomBoolean() ? randomInt() : null; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestParsingTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestParsingTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java index cc0989a27e925..d72a94ff41332 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestParsingTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestParsingTests.java @@ -17,17 +17,17 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.OpenSearchParseException; -import org.elasticsearch.index.VersionType; -import org.elasticsearch.ingest.CompoundProcessor; -import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.ingest.IngestService; -import org.elasticsearch.ingest.Pipeline; -import org.elasticsearch.ingest.Processor; -import org.elasticsearch.ingest.TestProcessor; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.OpenSearchParseException; +import org.opensearch.index.VersionType; +import org.opensearch.ingest.CompoundProcessor; +import org.opensearch.ingest.IngestDocument; +import org.opensearch.ingest.IngestService; +import org.opensearch.ingest.Pipeline; +import org.opensearch.ingest.Processor; +import org.opensearch.ingest.TestProcessor; +import org.opensearch.test.OpenSearchTestCase; import org.junit.Before; import java.io.IOException; @@ -39,23 +39,23 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.action.ingest.SimulatePipelineRequest.Fields; -import static org.elasticsearch.action.ingest.SimulatePipelineRequest.SIMULATED_PIPELINE_ID; -import static org.elasticsearch.ingest.IngestDocument.Metadata.ID; -import static org.elasticsearch.ingest.IngestDocument.Metadata.INDEX; -import static org.elasticsearch.ingest.IngestDocument.Metadata.ROUTING; -import static org.elasticsearch.ingest.IngestDocument.Metadata.TYPE; -import static org.elasticsearch.ingest.IngestDocument.Metadata.VERSION; -import static org.elasticsearch.ingest.IngestDocument.Metadata.VERSION_TYPE; -import static org.elasticsearch.ingest.IngestDocument.Metadata.IF_SEQ_NO; -import static org.elasticsearch.ingest.IngestDocument.Metadata.IF_PRIMARY_TERM; +import static org.opensearch.action.ingest.SimulatePipelineRequest.Fields; +import static org.opensearch.action.ingest.SimulatePipelineRequest.SIMULATED_PIPELINE_ID; +import static org.opensearch.ingest.IngestDocument.Metadata.ID; +import static org.opensearch.ingest.IngestDocument.Metadata.INDEX; +import static org.opensearch.ingest.IngestDocument.Metadata.ROUTING; +import static org.opensearch.ingest.IngestDocument.Metadata.TYPE; +import static org.opensearch.ingest.IngestDocument.Metadata.VERSION; +import static org.opensearch.ingest.IngestDocument.Metadata.VERSION_TYPE; +import static org.opensearch.ingest.IngestDocument.Metadata.IF_SEQ_NO; +import static org.opensearch.ingest.IngestDocument.Metadata.IF_PRIMARY_TERM; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class SimulatePipelineRequestParsingTests extends ESTestCase { +public class SimulatePipelineRequestParsingTests extends OpenSearchTestCase { private IngestService ingestService; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestTests.java index 53c307c430815..0cf889a790320 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineRequestTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineRequestTests.java @@ -17,20 +17,20 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.nio.charset.StandardCharsets; import static org.hamcrest.CoreMatchers.equalTo; -public class SimulatePipelineRequestTests extends ESTestCase { +public class SimulatePipelineRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { SimulatePipelineRequest request = new SimulatePipelineRequest(new BytesArray(""), XContentType.JSON); diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineResponseTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulatePipelineResponseTests.java index 97306829e5a8d..06b4110597293 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulatePipelineResponseTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractXContentTestCase; import java.io.IOException; import java.util.ArrayList; @@ -32,7 +32,7 @@ import java.util.function.Predicate; import java.util.function.Supplier; -import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; +import static org.opensearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java b/server/src/test/java/org/opensearch/action/ingest/SimulateProcessorResultTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java rename to server/src/test/java/org/opensearch/action/ingest/SimulateProcessorResultTests.java index 11a758bf57d43..c3a07784aa1d1 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateProcessorResultTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/SimulateProcessorResultTests.java @@ -17,24 +17,24 @@ * under the License. */ -package org.elasticsearch.action.ingest; +package org.opensearch.action.ingest; -import org.elasticsearch.Version; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractXContentTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Version; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.ingest.IngestDocument; +import org.opensearch.test.AbstractXContentTestCase; +import org.opensearch.test.VersionUtils; import java.io.IOException; import java.util.StringJoiner; import java.util.function.Predicate; import java.util.function.Supplier; -import static org.elasticsearch.action.ingest.WriteableIngestDocumentTests.createRandomIngestDoc; -import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; +import static org.opensearch.action.ingest.WriteableIngestDocumentTests.createRandomIngestDoc; +import static org.opensearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; diff --git a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java b/server/src/test/java/org/opensearch/action/ingest/WriteableIngestDocumentTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java rename to server/src/test/java/org/opensearch/action/ingest/WriteableIngestDocumentTests.java index 07aabf4a608c5..1a6f1a7a4b1a9 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java +++ b/server/src/test/java/org/opensearch/action/ingest/WriteableIngestDocumentTests.java @@ -17,20 +17,20 @@ * under the License. */ -package org.elasticsearch.action.ingest; - -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.ingest.RandomDocumentPicks; -import org.elasticsearch.ingest.IngestDocument; -import org.elasticsearch.test.AbstractXContentTestCase; -import org.elasticsearch.test.RandomObjects; +package org.opensearch.action.ingest; + +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.ingest.RandomDocumentPicks; +import org.opensearch.ingest.IngestDocument; +import org.opensearch.test.AbstractXContentTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.Collections; @@ -39,8 +39,8 @@ import java.util.StringJoiner; import java.util.function.Predicate; -import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS; -import static org.elasticsearch.ingest.IngestDocumentMatcher.assertIngestDocument; +import static org.opensearch.common.xcontent.ToXContent.EMPTY_PARAMS; +import static org.opensearch.ingest.IngestDocumentMatcher.assertIngestDocument; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; diff --git a/server/src/test/java/org/elasticsearch/action/main/MainActionTests.java b/server/src/test/java/org/opensearch/action/main/MainActionTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/main/MainActionTests.java rename to server/src/test/java/org/opensearch/action/main/MainActionTests.java index 9c00990473a8f..8ba235aa8bb0c 100644 --- a/server/src/test/java/org/elasticsearch/action/main/MainActionTests.java +++ b/server/src/test/java/org/opensearch/action/main/MainActionTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.main; +package org.opensearch.action.main; import org.opensearch.action.ActionListener; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.settings.Settings; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.settings.Settings; import org.opensearch.rest.RestStatus; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportService; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportService; import java.util.Collections; import java.util.concurrent.atomic.AtomicReference; @@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class MainActionTests extends ESTestCase { +public class MainActionTests extends OpenSearchTestCase { public void testMainActionClusterAvailable() { final ClusterService clusterService = mock(ClusterService.class); diff --git a/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java b/server/src/test/java/org/opensearch/action/main/MainResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java rename to server/src/test/java/org/opensearch/action/main/MainResponseTests.java index d86c6a4097d64..09e1cdc746d57 100644 --- a/server/src/test/java/org/elasticsearch/action/main/MainResponseTests.java +++ b/server/src/test/java/org/opensearch/action/main/MainResponseTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.main; +package org.opensearch.action.main; -import org.elasticsearch.Build; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.test.AbstractSerializingTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Build; +import org.opensearch.Version; +import org.opensearch.cluster.ClusterName; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.test.AbstractSerializingTestCase; +import org.opensearch.test.VersionUtils; import java.io.IOException; import java.util.Date; diff --git a/server/src/test/java/org/elasticsearch/action/resync/ResyncReplicationRequestTests.java b/server/src/test/java/org/opensearch/action/resync/ResyncReplicationRequestTests.java similarity index 80% rename from server/src/test/java/org/elasticsearch/action/resync/ResyncReplicationRequestTests.java rename to server/src/test/java/org/opensearch/action/resync/ResyncReplicationRequestTests.java index 6aab44b722d9d..2cb20b3832f66 100644 --- a/server/src/test/java/org/elasticsearch/action/resync/ResyncReplicationRequestTests.java +++ b/server/src/test/java/org/opensearch/action/resync/ResyncReplicationRequestTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.resync; +package org.opensearch.action.resync; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.translog.Translog; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.translog.Translog; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.nio.charset.Charset; import static org.hamcrest.Matchers.equalTo; -public class ResyncReplicationRequestTests extends ESTestCase { +public class ResyncReplicationRequestTests extends OpenSearchTestCase { public void testSerialization() throws IOException { final byte[] bytes = "{}".getBytes(Charset.forName("UTF-8")); diff --git a/server/src/test/java/org/elasticsearch/action/resync/TransportResyncReplicationActionTests.java b/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java similarity index 76% rename from server/src/test/java/org/elasticsearch/action/resync/TransportResyncReplicationActionTests.java rename to server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java index cb4160af8d385..3670160f9c3c9 100644 --- a/server/src/test/java/org/elasticsearch/action/resync/TransportResyncReplicationActionTests.java +++ b/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java @@ -16,43 +16,43 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.resync; +package org.opensearch.action.resync; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; -import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.IndexingPressure; +import org.opensearch.index.IndexSettings; +import org.opensearch.index.IndexingPressure; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.coordination.NoMasterBlockService; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.network.NetworkService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.ReplicationGroup; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.translog.Translog; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.nio.MockNioTransport; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.coordination.NoMasterBlockService; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.network.NetworkService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.PageCacheRecycler; +import org.opensearch.index.Index; +import org.opensearch.index.IndexService; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.ReplicationGroup; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.translog.Translog; +import org.opensearch.indices.IndicesService; +import org.opensearch.indices.SystemIndices; +import org.opensearch.indices.breaker.NoneCircuitBreakerService; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.MockTransportService; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.nio.MockNioTransport; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -64,10 +64,10 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.state; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; -import static org.elasticsearch.transport.TransportService.NOOP_TRANSPORT_INTERCEPTOR; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.state; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; +import static org.opensearch.transport.TransportService.NOOP_TRANSPORT_INTERCEPTOR; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; @@ -79,7 +79,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class TransportResyncReplicationActionTests extends ESTestCase { +public class TransportResyncReplicationActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/search/AbstractSearchAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/search/AbstractSearchAsyncActionTests.java rename to server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java index 4f60ab27a8779..401190e7a9a3f 100644 --- a/server/src/test/java/org/elasticsearch/action/search/AbstractSearchAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java @@ -17,27 +17,27 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.ActionListener; import org.opensearch.action.OriginalIndices; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.routing.GroupShardsIterator; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.query.MatchAllQueryBuilder; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.internal.ShardSearchRequest; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.routing.GroupShardsIterator; +import org.opensearch.common.UUIDs; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.util.set.Sets; +import org.opensearch.index.Index; +import org.opensearch.index.query.MatchAllQueryBuilder; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.internal.ShardSearchRequest; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.Transport; import java.util.ArrayList; import java.util.Collections; @@ -54,7 +54,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.instanceOf; -public class AbstractSearchAsyncActionTests extends ESTestCase { +public class AbstractSearchAsyncActionTests extends OpenSearchTestCase { private final List> resolvedNodes = new ArrayList<>(); private final Set releasedContexts = new CopyOnWriteArraySet<>(); diff --git a/server/src/test/java/org/elasticsearch/action/search/BottomSortValuesCollectorTests.java b/server/src/test/java/org/opensearch/action/search/BottomSortValuesCollectorTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/action/search/BottomSortValuesCollectorTests.java rename to server/src/test/java/org/opensearch/action/search/BottomSortValuesCollectorTests.java index 7c626f33e9c40..ee16eb9d932e8 100644 --- a/server/src/test/java/org/elasticsearch/action/search/BottomSortValuesCollectorTests.java +++ b/server/src/test/java/org/opensearch/action/search/BottomSortValuesCollectorTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.FieldComparator; import org.apache.lucene.search.FieldDoc; @@ -25,20 +25,20 @@ import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.search.TotalHits; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.common.time.DateUtils; -import org.elasticsearch.index.mapper.DateFieldMapper; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.time.DateUtils; +import org.opensearch.index.mapper.DateFieldMapper; +import org.opensearch.search.DocValueFormat; +import org.opensearch.test.OpenSearchTestCase; import java.time.ZoneId; import java.util.Arrays; import static org.apache.lucene.search.TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO; -import static org.elasticsearch.index.mapper.DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER; +import static org.opensearch.index.mapper.DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -public class BottomSortValuesCollectorTests extends ESTestCase { +public class BottomSortValuesCollectorTests extends OpenSearchTestCase { public void testWithStrings() { for (boolean reverse : new boolean[] { true, false }) { SortField[] sortFields = new SortField[] { new SortField("foo", SortField.Type.STRING_VAL, reverse) }; diff --git a/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java b/server/src/test/java/org/opensearch/action/search/CanMatchPreFilterSearchPhaseTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java rename to server/src/test/java/org/opensearch/action/search/CanMatchPreFilterSearchPhaseTests.java index 0d6e00afc7c15..52c48317d0ab1 100644 --- a/server/src/test/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhaseTests.java +++ b/server/src/test/java/org/opensearch/action/search/CanMatchPreFilterSearchPhaseTests.java @@ -16,29 +16,29 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.GroupShardsIterator; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchService; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.search.internal.ShardSearchRequest; -import org.elasticsearch.search.sort.MinAndMax; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.search.sort.SortOrder; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.GroupShardsIterator; +import org.opensearch.common.Strings; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchService; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.search.internal.ShardSearchRequest; +import org.opensearch.search.sort.MinAndMax; +import org.opensearch.search.sort.SortBuilders; +import org.opensearch.search.sort.SortOrder; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.Transport; import java.io.IOException; import java.util.ArrayList; @@ -57,7 +57,7 @@ import static org.hamcrest.Matchers.equalTo; -public class CanMatchPreFilterSearchPhaseTests extends ESTestCase { +public class CanMatchPreFilterSearchPhaseTests extends OpenSearchTestCase { public void testFilterShards() throws InterruptedException { diff --git a/server/src/test/java/org/elasticsearch/action/search/ClearScrollControllerTests.java b/server/src/test/java/org/opensearch/action/search/ClearScrollControllerTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/search/ClearScrollControllerTests.java rename to server/src/test/java/org/opensearch/action/search/ClearScrollControllerTests.java index 64596334b5f7d..f94bd14301e98 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ClearScrollControllerTests.java +++ b/server/src/test/java/org/opensearch/action/search/ClearScrollControllerTests.java @@ -16,24 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.LatchedActionListener; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; -import org.elasticsearch.transport.NodeNotConnectedException; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportResponse; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.common.UUIDs; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; +import org.opensearch.transport.NodeNotConnectedException; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportResponse; import java.io.IOException; import java.util.Arrays; @@ -44,7 +44,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; -public class ClearScrollControllerTests extends ESTestCase { +public class ClearScrollControllerTests extends OpenSearchTestCase { public void testClearAll() throws InterruptedException { DiscoveryNode node1 = new DiscoveryNode("node_1", buildNewFakeTransportAddress(), Version.CURRENT); diff --git a/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java b/server/src/test/java/org/opensearch/action/search/ClearScrollRequestTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java rename to server/src/test/java/org/opensearch/action/search/ClearScrollRequestTests.java index 9aaf10930b091..707698cbfd160 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ClearScrollRequestTests.java +++ b/server/src/test/java/org/opensearch/action/search/ClearScrollRequestTests.java @@ -17,26 +17,26 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.startsWith; -public class ClearScrollRequestTests extends ESTestCase { +public class ClearScrollRequestTests extends OpenSearchTestCase { public void testFromXContent() throws Exception { ClearScrollRequest clearScrollRequest = new ClearScrollRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/search/CountedCollectorTests.java b/server/src/test/java/org/opensearch/action/search/CountedCollectorTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/search/CountedCollectorTests.java rename to server/src/test/java/org/opensearch/action/search/CountedCollectorTests.java index ab8868568b4c7..d2b63f21a0c99 100644 --- a/server/src/test/java/org/elasticsearch/action/search/CountedCollectorTests.java +++ b/server/src/test/java/org/opensearch/action/search/CountedCollectorTests.java @@ -16,24 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.dfs.DfsSearchResult; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.UUIDs; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.dfs.DfsSearchResult; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; -public class CountedCollectorTests extends ESTestCase { +public class CountedCollectorTests extends OpenSearchTestCase { public void testCollect() throws InterruptedException { ArraySearchPhaseResults consumer = new ArraySearchPhaseResults<>(randomIntBetween(1, 100)); List state = new ArrayList<>(); diff --git a/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java b/server/src/test/java/org/opensearch/action/search/DfsQueryPhaseTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java rename to server/src/test/java/org/opensearch/action/search/DfsQueryPhaseTests.java index 11905c7a2a102..faf299d13985c 100644 --- a/server/src/test/java/org/elasticsearch/action/search/DfsQueryPhaseTests.java +++ b/server/src/test/java/org/opensearch/action/search/DfsQueryPhaseTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.index.Term; import org.apache.lucene.search.ScoreDoc; @@ -25,28 +25,28 @@ import org.apache.lucene.search.TotalHits; import org.apache.lucene.store.MockDirectoryWrapper; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.dfs.DfsSearchResult; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.query.QuerySearchRequest; -import org.elasticsearch.search.query.QuerySearchResult; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.InternalAggregationTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.NoopCircuitBreaker; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.dfs.DfsSearchResult; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.query.QuerySearchRequest; +import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.InternalAggregationTestCase; +import org.opensearch.transport.Transport; import java.io.IOException; import java.io.UncheckedIOException; import java.util.concurrent.atomic.AtomicReference; -public class DfsQueryPhaseTests extends ESTestCase { +public class DfsQueryPhaseTests extends OpenSearchTestCase { private static DfsSearchResult newSearchResult(int shardIndex, ShardSearchContextId contextId, SearchShardTarget target) { DfsSearchResult result = new DfsSearchResult(contextId, target, null); diff --git a/server/src/test/java/org/elasticsearch/action/search/ExpandSearchPhaseTests.java b/server/src/test/java/org/opensearch/action/search/ExpandSearchPhaseTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/ExpandSearchPhaseTests.java rename to server/src/test/java/org/opensearch/action/search/ExpandSearchPhaseTests.java index c93417bf56cdc..7735ef8a3ff37 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ExpandSearchPhaseTests.java +++ b/server/src/test/java/org/opensearch/action/search/ExpandSearchPhaseTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.TotalHits; import org.opensearch.action.ActionListener; -import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.text.Text; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.InnerHitBuilder; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.collapse.CollapseBuilder; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.document.DocumentField; +import org.opensearch.common.text.Text; +import org.opensearch.index.query.BoolQueryBuilder; +import org.opensearch.index.query.InnerHitBuilder; +import org.opensearch.index.query.QueryBuilder; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.test.OpenSearchTestCase; import org.hamcrest.Matchers; import java.io.IOException; @@ -43,7 +43,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -public class ExpandSearchPhaseTests extends ESTestCase { +public class ExpandSearchPhaseTests extends OpenSearchTestCase { public void testCollapseSingleHit() throws IOException { final int iters = randomIntBetween(5, 10); diff --git a/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java b/server/src/test/java/org/opensearch/action/search/FetchSearchPhaseTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java rename to server/src/test/java/org/opensearch/action/search/FetchSearchPhaseTests.java index d7fa666270c60..78b0638ae2ffa 100644 --- a/server/src/test/java/org/elasticsearch/action/search/FetchSearchPhaseTests.java +++ b/server/src/test/java/org/opensearch/action/search/FetchSearchPhaseTests.java @@ -16,36 +16,36 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TotalHits; import org.apache.lucene.store.MockDirectoryWrapper; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.fetch.FetchSearchResult; -import org.elasticsearch.search.fetch.QueryFetchSearchResult; -import org.elasticsearch.search.fetch.ShardFetchSearchRequest; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.query.QuerySearchResult; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.InternalAggregationTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.common.UUIDs; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.NoopCircuitBreaker; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.fetch.FetchSearchResult; +import org.opensearch.search.fetch.QueryFetchSearchResult; +import org.opensearch.search.fetch.ShardFetchSearchRequest; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.InternalAggregationTestCase; +import org.opensearch.transport.Transport; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; -public class FetchSearchPhaseTests extends ESTestCase { +public class FetchSearchPhaseTests extends OpenSearchTestCase { public void testShortcutQueryAndFetchOptimization() { SearchPhaseController controller = new SearchPhaseController( diff --git a/server/src/test/java/org/elasticsearch/action/search/MockSearchPhaseContext.java b/server/src/test/java/org/opensearch/action/search/MockSearchPhaseContext.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/search/MockSearchPhaseContext.java rename to server/src/test/java/org/opensearch/action/search/MockSearchPhaseContext.java index 5ca5c448f0355..cdd3478827386 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MockSearchPhaseContext.java +++ b/server/src/test/java/org/opensearch/action/search/MockSearchPhaseContext.java @@ -16,21 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.internal.ShardSearchRequest; -import org.elasticsearch.transport.Transport; +import org.opensearch.common.Nullable; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.internal.ShardSearchRequest; +import org.opensearch.transport.Transport; import org.junit.Assert; import java.util.ArrayList; diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchActionTookTests.java b/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/search/MultiSearchActionTookTests.java rename to server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java index cb6ba6ccd51f2..1824c8b64467a 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchActionTookTests.java +++ b/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java @@ -17,30 +17,30 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.ActionListener; import org.opensearch.action.IndicesRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Randomness; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportService; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Randomness; +import org.opensearch.common.UUIDs; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -58,7 +58,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.mockito.Mockito.mock; @@ -67,7 +67,7 @@ /** * MultiSearch took time tests */ -public class MultiSearchActionTookTests extends ESTestCase { +public class MultiSearchActionTookTests extends OpenSearchTestCase { private ThreadPool threadPool; private ClusterService clusterService; diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java b/server/src/test/java/org/opensearch/action/search/MultiSearchRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java rename to server/src/test/java/org/opensearch/action/search/MultiSearchRequestTests.java index cd22d65298c7d..1f37ee3e99e9c 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchRequestTests.java +++ b/server/src/test/java/org/opensearch/action/search/MultiSearchRequestTests.java @@ -17,31 +17,31 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.CheckedBiConsumer; -import org.elasticsearch.common.CheckedRunnable; -import org.elasticsearch.common.ParseField; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.query.MatchAllQueryBuilder; -import org.elasticsearch.index.query.QueryBuilder; +import org.opensearch.common.CheckedBiConsumer; +import org.opensearch.common.CheckedRunnable; +import org.opensearch.common.ParseField; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.logging.DeprecationLogger; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.query.MatchAllQueryBuilder; +import org.opensearch.index.query.QueryBuilder; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.search.RestMultiSearchAction; -import org.elasticsearch.search.Scroll; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.StreamsUtils; -import org.elasticsearch.test.rest.FakeRestRequest; +import org.opensearch.search.Scroll; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.StreamsUtils; +import org.opensearch.test.rest.FakeRestRequest; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -51,14 +51,14 @@ import java.util.Map; import static java.util.Collections.singletonList; -import static org.elasticsearch.search.RandomSearchRequestGenerator.randomSearchRequest; -import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; +import static org.opensearch.search.RandomSearchRequestGenerator.randomSearchRequest; +import static org.opensearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; -public class MultiSearchRequestTests extends ESTestCase { +public class MultiSearchRequestTests extends OpenSearchTestCase { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(MultiSearchRequestTests.class); diff --git a/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java b/server/src/test/java/org/opensearch/action/search/MultiSearchResponseTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java rename to server/src/test/java/org/opensearch/action/search/MultiSearchResponseTests.java index d78f3efc354c2..0fa4a9a201e86 100644 --- a/server/src/test/java/org/elasticsearch/action/search/MultiSearchResponseTests.java +++ b/server/src/test/java/org/opensearch/action/search/MultiSearchResponseTests.java @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.test.AbstractXContentTestCase; +import org.opensearch.OpenSearchException; +import org.opensearch.common.Strings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.test.AbstractXContentTestCase; import java.io.IOException; import java.util.function.Predicate; diff --git a/server/src/test/java/org/elasticsearch/action/search/ParsedScrollIdTests.java b/server/src/test/java/org/opensearch/action/search/ParsedScrollIdTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/search/ParsedScrollIdTests.java rename to server/src/test/java/org/opensearch/action/search/ParsedScrollIdTests.java index 789638acde91d..10db917466796 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ParsedScrollIdTests.java +++ b/server/src/test/java/org/opensearch/action/search/ParsedScrollIdTests.java @@ -17,12 +17,12 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; -public class ParsedScrollIdTests extends ESTestCase { +public class ParsedScrollIdTests extends OpenSearchTestCase { public void testHasLocalIndices() { final int nResults = randomIntBetween(1, 3); final SearchContextIdForNode[] searchContextIdForNodes = new SearchContextIdForNode[nResults]; diff --git a/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java b/server/src/test/java/org/opensearch/action/search/QueryPhaseResultConsumerTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java rename to server/src/test/java/org/opensearch/action/search/QueryPhaseResultConsumerTests.java index 4606d20b36192..042066d3d9d23 100644 --- a/server/src/test/java/org/elasticsearch/action/search/QueryPhaseResultConsumerTests.java +++ b/server/src/test/java/org/opensearch/action/search/QueryPhaseResultConsumerTests.java @@ -17,28 +17,28 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.TotalHits; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.InternalAggregations; -import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; -import org.elasticsearch.search.query.QuerySearchResult; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.NoopCircuitBreaker; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; +import org.opensearch.common.util.BigArrays; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.common.util.concurrent.EsThreadPoolExecutor; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.aggregations.InternalAggregation; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.aggregations.pipeline.PipelineAggregator; +import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; @@ -50,7 +50,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -public class QueryPhaseResultConsumerTests extends ESTestCase { +public class QueryPhaseResultConsumerTests extends OpenSearchTestCase { private SearchPhaseController searchPhaseController; private ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/SearchAsyncActionTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/SearchAsyncActionTests.java rename to server/src/test/java/org/opensearch/action/search/SearchAsyncActionTests.java index 48a023d7a7fc7..d0f58bc6ccf79 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchAsyncActionTests.java @@ -16,32 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.GroupShardsIterator; -import org.elasticsearch.cluster.routing.RecoverySource; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.UnassignedInfo; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.transport.TransportRequestOptions; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.GroupShardsIterator; +import org.opensearch.cluster.routing.RecoverySource; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.UnassignedInfo; +import org.opensearch.common.Strings; +import org.opensearch.common.UUIDs; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportRequest; +import org.opensearch.transport.TransportRequestOptions; import java.io.IOException; import java.util.ArrayList; @@ -58,12 +58,12 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.newConcurrentMap; -import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.newConcurrentSet; +import static org.opensearch.common.util.concurrent.ConcurrentCollections.newConcurrentMap; +import static org.opensearch.common.util.concurrent.ConcurrentCollections.newConcurrentSet; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThanOrEqualTo; -public class SearchAsyncActionTests extends ESTestCase { +public class SearchAsyncActionTests extends OpenSearchTestCase { public void testSkipSearchShards() throws InterruptedException { SearchRequest request = new SearchRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchContextIdTests.java b/server/src/test/java/org/opensearch/action/search/SearchContextIdTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/search/SearchContextIdTests.java rename to server/src/test/java/org/opensearch/action/search/SearchContextIdTests.java index 130128eb55af3..1e43be5617ae5 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchContextIdTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchContextIdTests.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.index.query.IdsQueryBuilder; -import org.elasticsearch.index.query.MatchAllQueryBuilder; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.TermQueryBuilder; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.Version; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.index.query.IdsQueryBuilder; +import org.opensearch.index.query.MatchAllQueryBuilder; +import org.opensearch.index.query.QueryBuilder; +import org.opensearch.index.query.TermQueryBuilder; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.test.OpenSearchTestCase; import java.util.Arrays; import java.util.HashMap; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.nullValue; -public class SearchContextIdTests extends ESTestCase { +public class SearchContextIdTests extends OpenSearchTestCase { QueryBuilder randomQueryBuilder() { if (randomBoolean()) { diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java b/server/src/test/java/org/opensearch/action/search/SearchPhaseControllerTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java rename to server/src/test/java/org/opensearch/action/search/SearchPhaseControllerTests.java index 0c7b1d0af173a..b8f1be500b661 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseControllerTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchPhaseControllerTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import com.carrotsearch.randomizedtesting.RandomizedContext; @@ -31,48 +31,48 @@ import org.apache.lucene.search.grouping.CollapseTopFieldDocs; import org.apache.lucene.util.BytesRef; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.CircuitBreakingException; -import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.lucene.Lucene; -import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.InternalAggregation.ReduceContext; -import org.elasticsearch.search.aggregations.InternalAggregations; -import org.elasticsearch.search.aggregations.metrics.InternalMax; -import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.fetch.FetchSearchResult; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.SearchContext; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.query.QuerySearchResult; -import org.elasticsearch.search.suggest.SortBy; -import org.elasticsearch.search.suggest.Suggest; -import org.elasticsearch.search.suggest.completion.CompletionSuggestion; -import org.elasticsearch.search.suggest.phrase.PhraseSuggestion; -import org.elasticsearch.search.suggest.term.TermSuggestion; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.InternalAggregationTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.common.Strings; +import org.opensearch.common.UUIDs; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.CircuitBreakingException; +import org.opensearch.common.breaker.NoopCircuitBreaker; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.lucene.Lucene; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.text.Text; +import org.opensearch.common.util.BigArrays; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.common.util.concurrent.EsThreadPoolExecutor; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.SearchModule; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.aggregations.AggregationBuilders; +import org.opensearch.search.aggregations.InternalAggregation; +import org.opensearch.search.aggregations.InternalAggregation.ReduceContext; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.aggregations.metrics.InternalMax; +import org.opensearch.search.aggregations.pipeline.PipelineAggregator.PipelineTree; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.fetch.FetchSearchResult; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.suggest.SortBy; +import org.opensearch.search.suggest.Suggest; +import org.opensearch.search.suggest.completion.CompletionSuggestion; +import org.opensearch.search.suggest.phrase.PhraseSuggestion; +import org.opensearch.search.suggest.term.TermSuggestion; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.InternalAggregationTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; @@ -100,7 +100,7 @@ import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; -public class SearchPhaseControllerTests extends ESTestCase { +public class SearchPhaseControllerTests extends OpenSearchTestCase { private ThreadPool threadPool; private EsThreadPoolExecutor fixedExecutor; private SearchPhaseController searchPhaseController; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java rename to server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java index 0c1a49c0c3f9f..535ff6a701a82 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchPhaseExecutionExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java @@ -17,33 +17,33 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.OriginalIndices; import org.opensearch.action.TimestampParsingException; -import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.shard.IndexShardClosedException; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.InvalidIndexTemplateException; +import org.opensearch.common.ParsingException; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContent; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.shard.IndexShardClosedException; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.InvalidIndexTemplateException; import org.opensearch.rest.RestStatus; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.Matchers.hasSize; -public class SearchPhaseExecutionExceptionTests extends ESTestCase { +public class SearchPhaseExecutionExceptionTests extends OpenSearchTestCase { public void testToXContent() throws IOException { SearchPhaseExecutionException exception = new SearchPhaseExecutionException("test", "all shards failed", @@ -133,7 +133,7 @@ public void testPhaseFailureWithoutSearchShardFailure() { final ShardSearchFailure[] searchShardFailures = new ShardSearchFailure[0]; final String phase = randomFrom("fetch", "search", "other"); SearchPhaseExecutionException actual = new SearchPhaseExecutionException(phase, "unexpected failures", - new EsRejectedExecutionException("ES rejected execution of fetch phase"), searchShardFailures); + new EsRejectedExecutionException("OpenSearch rejected execution of fetch phase"), searchShardFailures); assertEquals(actual.status(), RestStatus.TOO_MANY_REQUESTS); } @@ -159,7 +159,7 @@ public void testPhaseFailureWithSearchShardFailure() { final String phase = randomFrom("fetch", "search", "other"); SearchPhaseExecutionException actual = new SearchPhaseExecutionException(phase, "unexpected failures", - new EsRejectedExecutionException("ES rejected execution of fetch phase"), shardSearchFailures); + new EsRejectedExecutionException("OpenSearch rejected execution of fetch phase"), shardSearchFailures); assertEquals(actual.status(), RestStatus.BAD_REQUEST); } diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java rename to server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java index 35af3f7af42d4..81518ce942c5c 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchQueryThenFetchAsyncActionTests.java @@ -17,37 +17,37 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TopFieldDocs; import org.apache.lucene.search.TotalHits; import org.apache.lucene.search.grouping.CollapseTopFieldDocs; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.GroupShardsIterator; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.lucene.search.TopDocsAndMaxScore; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.EsExecutors; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.collapse.CollapseBuilder; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.search.internal.ShardSearchRequest; -import org.elasticsearch.search.query.QuerySearchResult; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.InternalAggregationTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.GroupShardsIterator; +import org.opensearch.common.Strings; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.NoopCircuitBreaker; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.EsExecutors; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.search.internal.ShardSearchRequest; +import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.sort.SortBuilders; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.InternalAggregationTestCase; +import org.opensearch.transport.Transport; import java.util.Collections; import java.util.Map; @@ -61,7 +61,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.instanceOf; -public class SearchQueryThenFetchAsyncActionTests extends ESTestCase { +public class SearchQueryThenFetchAsyncActionTests extends OpenSearchTestCase { public void testBottomFieldSort() throws Exception { testCase(false, false); } diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchRequestBuilderTests.java b/server/src/test/java/org/opensearch/action/search/SearchRequestBuilderTests.java similarity index 87% rename from server/src/test/java/org/elasticsearch/action/search/SearchRequestBuilderTests.java rename to server/src/test/java/org/opensearch/action/search/SearchRequestBuilderTests.java index 38f872dea2f4c..686b1f6fd5a8b 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchRequestBuilderTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchRequestBuilderTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.client.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.env.Environment; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.MockTransportClient; +import org.opensearch.client.Client; +import org.opensearch.common.settings.Settings; +import org.opensearch.env.Environment; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.MockTransportClient; import org.junit.AfterClass; import org.junit.BeforeClass; import static org.hamcrest.CoreMatchers.equalTo; -public class SearchRequestBuilderTests extends ESTestCase { +public class SearchRequestBuilderTests extends OpenSearchTestCase { private static Client client; @BeforeClass diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java b/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java rename to server/src/test/java/org/opensearch/action/search/SearchRequestTests.java index 8b3fd24f278cb..a9cc90b359686 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchRequestTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchRequestTests.java @@ -17,24 +17,24 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.ArrayUtils; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.search.AbstractSearchTestCase; -import org.elasticsearch.search.Scroll; -import org.elasticsearch.search.builder.PointInTimeBuilder; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.rescore.QueryRescorerBuilder; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.ArrayUtils; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.search.AbstractSearchTestCase; +import org.opensearch.search.Scroll; +import org.opensearch.search.builder.PointInTimeBuilder; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.rescore.QueryRescorerBuilder; +import org.opensearch.tasks.TaskId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import java.io.IOException; import java.util.ArrayList; @@ -42,7 +42,7 @@ import java.util.List; import static java.util.Collections.emptyMap; -import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; +import static org.opensearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -239,7 +239,7 @@ private SearchRequest mutate(SearchRequest searchRequest) { mutators.add(() -> mutation.types(ArrayUtils.concat(searchRequest.types(), new String[] { randomAlphaOfLength(10) }))); mutators.add(() -> mutation.preference(randomValueOtherThan(searchRequest.preference(), () -> randomAlphaOfLengthBetween(3, 10)))); mutators.add(() -> mutation.routing(randomValueOtherThan(searchRequest.routing(), () -> randomAlphaOfLengthBetween(3, 10)))); - mutators.add(() -> mutation.requestCache((randomValueOtherThan(searchRequest.requestCache(), ESTestCase::randomBoolean)))); + mutators.add(() -> mutation.requestCache((randomValueOtherThan(searchRequest.requestCache(), OpenSearchTestCase::randomBoolean)))); mutators.add(() -> mutation .scroll(randomValueOtherThan(searchRequest.scroll(), () -> new Scroll(new TimeValue(randomNonNegativeLong() % 100000))))); mutators.add(() -> mutation.searchType(randomValueOtherThan(searchRequest.searchType(), diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchResponseMergerTests.java b/server/src/test/java/org/opensearch/action/search/SearchResponseMergerTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/search/SearchResponseMergerTests.java rename to server/src/test/java/org/opensearch/action/search/SearchResponseMergerTests.java index ff8a424c736f8..785f7a23989c4 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchResponseMergerTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchResponseMergerTests.java @@ -17,36 +17,36 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.SortField; import org.apache.lucene.search.TotalHits; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.text.Text; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.DocValueFormat; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.aggregations.InternalAggregations; -import org.elasticsearch.search.aggregations.bucket.range.InternalDateRange; -import org.elasticsearch.search.aggregations.bucket.range.Range; -import org.elasticsearch.search.aggregations.metrics.InternalMax; -import org.elasticsearch.search.aggregations.metrics.Max; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.SearchContext; -import org.elasticsearch.search.profile.ProfileShardResult; -import org.elasticsearch.search.profile.SearchProfileShardResults; -import org.elasticsearch.search.profile.SearchProfileShardResultsTests; -import org.elasticsearch.search.suggest.Suggest; -import org.elasticsearch.search.suggest.completion.CompletionSuggestion; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.RemoteClusterAware; -import org.elasticsearch.transport.RemoteClusterService; +import org.opensearch.action.search.TransportSearchAction.SearchTimeProvider; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.text.Text; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.aggregations.bucket.range.InternalDateRange; +import org.opensearch.search.aggregations.bucket.range.Range; +import org.opensearch.search.aggregations.metrics.InternalMax; +import org.opensearch.search.aggregations.metrics.Max; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.profile.ProfileShardResult; +import org.opensearch.search.profile.SearchProfileShardResults; +import org.opensearch.search.profile.SearchProfileShardResultsTests; +import org.opensearch.search.suggest.Suggest; +import org.opensearch.search.suggest.completion.CompletionSuggestion; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.RemoteClusterAware; +import org.opensearch.transport.RemoteClusterService; import org.junit.Before; import java.util.ArrayList; @@ -65,13 +65,13 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; -import static org.elasticsearch.test.InternalAggregationTestCase.emptyReduceContextBuilder; +import static org.opensearch.test.InternalAggregationTestCase.emptyReduceContextBuilder; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.lessThanOrEqualTo; -public class SearchResponseMergerTests extends ESTestCase { +public class SearchResponseMergerTests extends OpenSearchTestCase { private int numResponses; private ExecutorService executorService; diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java b/server/src/test/java/org/opensearch/action/search/SearchResponseTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java rename to server/src/test/java/org/opensearch/action/search/SearchResponseTests.java index 43096c063c3e7..2d5f685ce018a 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchResponseTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchResponseTests.java @@ -17,36 +17,36 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.TotalHits; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.text.Text; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; +import org.opensearch.Version; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.text.Text; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.action.search.RestSearchAction; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.SearchHitsTests; -import org.elasticsearch.search.SearchModule; -import org.elasticsearch.search.aggregations.AggregationsTests; -import org.elasticsearch.search.aggregations.InternalAggregations; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.profile.SearchProfileShardResults; -import org.elasticsearch.search.profile.SearchProfileShardResultsTests; -import org.elasticsearch.search.suggest.Suggest; -import org.elasticsearch.search.suggest.SuggestTests; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.InternalAggregationTestCase; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.SearchHitsTests; +import org.opensearch.search.SearchModule; +import org.opensearch.search.aggregations.AggregationsTests; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.profile.SearchProfileShardResults; +import org.opensearch.search.profile.SearchProfileShardResultsTests; +import org.opensearch.search.suggest.Suggest; +import org.opensearch.search.suggest.SuggestTests; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.InternalAggregationTestCase; import org.junit.After; import org.junit.Before; @@ -57,10 +57,10 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonMap; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; -public class SearchResponseTests extends ESTestCase { +public class SearchResponseTests extends OpenSearchTestCase { private static final NamedXContentRegistry xContentRegistry; static { diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchScrollAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/SearchScrollAsyncActionTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/search/SearchScrollAsyncActionTests.java rename to server/src/test/java/org/opensearch/action/search/SearchScrollAsyncActionTests.java index 13adf8b52d76a..78193a33e5f7b 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchScrollAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchScrollAsyncActionTests.java @@ -16,23 +16,23 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.Scroll; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.InternalScrollSearchRequest; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.Transport; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.common.UUIDs; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.Scroll; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.InternalScrollSearchRequest; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.Transport; import java.io.IOException; import java.util.Arrays; @@ -42,7 +42,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiFunction; -public class SearchScrollAsyncActionTests extends ESTestCase { +public class SearchScrollAsyncActionTests extends OpenSearchTestCase { public void testSendRequestsToNodes() throws InterruptedException { diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java b/server/src/test/java/org/opensearch/action/search/SearchScrollRequestTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java rename to server/src/test/java/org/opensearch/action/search/SearchScrollRequestTests.java index 389d8933a23dd..7f65438403414 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchScrollRequestTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchScrollRequestTests.java @@ -17,32 +17,32 @@ * under the License. */ -package org.elasticsearch.action.search; - -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.search.internal.InternalScrollSearchRequest; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.search; + +import org.opensearch.common.Strings; +import org.opensearch.common.UUIDs; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.search.internal.InternalScrollSearchRequest; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; -import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; import static org.hamcrest.Matchers.startsWith; -public class SearchScrollRequestTests extends ESTestCase { +public class SearchScrollRequestTests extends OpenSearchTestCase { public void testSerialization() throws Exception { SearchScrollRequest searchScrollRequest = createSearchScrollRequest(); diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchShardIteratorTests.java b/server/src/test/java/org/opensearch/action/search/SearchShardIteratorTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/search/SearchShardIteratorTests.java rename to server/src/test/java/org/opensearch/action/search/SearchShardIteratorTests.java index 6c44816d69aa0..cc7df1079f328 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchShardIteratorTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchShardIteratorTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.action.OriginalIndicesTests; +import org.opensearch.action.OriginalIndicesTests; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.cluster.routing.GroupShardsIteratorTests; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.opensearch.cluster.routing.GroupShardsIteratorTests; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.EqualsHashCodeTestUtils; import org.hamcrest.Matchers; import java.util.ArrayList; @@ -36,7 +36,7 @@ import static org.hamcrest.Matchers.equalTo; -public class SearchShardIteratorTests extends ESTestCase { +public class SearchShardIteratorTests extends OpenSearchTestCase { public void testShardId() { ShardId shardId = new ShardId(randomAlphaOfLengthBetween(5, 10), randomAlphaOfLength(10), randomInt()); diff --git a/server/src/test/java/org/elasticsearch/action/search/SearchShardTests.java b/server/src/test/java/org/opensearch/action/search/SearchShardTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/search/SearchShardTests.java rename to server/src/test/java/org/opensearch/action/search/SearchShardTests.java index 8ee1718023e69..888ae99090a04 100644 --- a/server/src/test/java/org/elasticsearch/action/search/SearchShardTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchShardTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.EqualsHashCodeTestUtils; import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class SearchShardTests extends ESTestCase { +public class SearchShardTests extends OpenSearchTestCase { public void testEqualsAndHashcode() { String index = randomAlphaOfLengthBetween(5, 10); diff --git a/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java b/server/src/test/java/org/opensearch/action/search/ShardSearchFailureTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java rename to server/src/test/java/org/opensearch/action/search/ShardSearchFailureTests.java index b72422ab72868..b2c6e2419894f 100644 --- a/server/src/test/java/org/elasticsearch/action/search/ShardSearchFailureTests.java +++ b/server/src/test/java/org/opensearch/action/search/ShardSearchFailureTests.java @@ -17,27 +17,27 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.common.ParsingException; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.ParsingException; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import java.io.IOException; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; -public class ShardSearchFailureTests extends ESTestCase { +public class ShardSearchFailureTests extends OpenSearchTestCase { public static ShardSearchFailure createTestItem(String indexUuid) { String randomMessage = randomAlphaOfLengthBetween(3, 20); @@ -90,14 +90,14 @@ private void doFromXContentTestWithRandomFields(boolean addRandomFields) throws /* * we cannot compare the cause, because it will be wrapped in an outer - * ElasticSearchException best effort: try to check that the original + * OpenSearchException best effort: try to check that the original * message appears somewhere in the rendered xContent */ String originalMsg = response.getCause().getMessage(); - assertEquals(parsed.getCause().getMessage(), "Elasticsearch exception [type=parsing_exception, reason=" + originalMsg + "]"); + assertEquals(parsed.getCause().getMessage(), "OpenSearch exception [type=parsing_exception, reason=" + originalMsg + "]"); String nestedMsg = response.getCause().getCause().getMessage(); assertEquals(parsed.getCause().getCause().getMessage(), - "Elasticsearch exception [type=illegal_argument_exception, reason=" + nestedMsg + "]"); + "OpenSearch exception [type=illegal_argument_exception, reason=" + nestedMsg + "]"); } public void testToXContent() throws IOException { diff --git a/server/src/test/java/org/elasticsearch/action/search/TransportMultiSearchActionTests.java b/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/search/TransportMultiSearchActionTests.java rename to server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java index 450c12c2754c7..fc836da4d6b40 100644 --- a/server/src/test/java/org/elasticsearch/action/search/TransportMultiSearchActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java @@ -17,31 +17,31 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.support.ActionFilter; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Randomness; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportService; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Randomness; +import org.opensearch.common.UUIDs; +import org.opensearch.common.settings.Settings; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportService; import java.util.Arrays; import java.util.Collections; @@ -58,7 +58,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class TransportMultiSearchActionTests extends ESTestCase { +public class TransportMultiSearchActionTests extends OpenSearchTestCase { public void testParentTaskId() throws Exception { // Initialize dependencies of TransportMultiSearchAction @@ -111,7 +111,7 @@ public String getLocalNodeId() { future.get(); assertEquals(numSearchRequests, counter.get()); } finally { - assertTrue(ESTestCase.terminate(threadPool)); + assertTrue(OpenSearchTestCase.terminate(threadPool)); } } @@ -190,7 +190,7 @@ public String getLocalNodeId() { assertThat(requests.size(), equalTo(numSearchRequests)); assertThat(errorHolder.get(), nullValue()); } finally { - assertTrue(ESTestCase.terminate(threadPool)); + assertTrue(OpenSearchTestCase.terminate(threadPool)); } } diff --git a/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java b/server/src/test/java/org/opensearch/action/search/TransportSearchActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java rename to server/src/test/java/org/opensearch/action/search/TransportSearchActionTests.java index 33fa019fe3a8e..961d36b83480e 100644 --- a/server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/TransportSearchActionTests.java @@ -17,66 +17,66 @@ * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; import org.apache.lucene.search.TotalHits; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.OriginalIndices; -import org.elasticsearch.action.OriginalIndicesTests; +import org.opensearch.action.OriginalIndicesTests; import org.opensearch.action.admin.cluster.shards.ClusterSearchShardsGroup; import org.opensearch.action.admin.cluster.shards.ClusterSearchShardsResponse; import org.opensearch.action.support.IndicesOptions; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.GroupShardsIterator; -import org.elasticsearch.cluster.routing.GroupShardsIteratorTests; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.query.InnerHitBuilder; -import org.elasticsearch.index.query.MatchAllQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.query.TermsQueryBuilder; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.GroupShardsIterator; +import org.opensearch.cluster.routing.GroupShardsIteratorTests; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.common.Strings; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.transport.TransportAddress; +import org.opensearch.index.Index; +import org.opensearch.index.query.InnerHitBuilder; +import org.opensearch.index.query.MatchAllQueryBuilder; +import org.opensearch.index.query.QueryBuilders; +import org.opensearch.index.query.TermsQueryBuilder; +import org.opensearch.index.shard.ShardId; import org.opensearch.rest.RestStatus; -import org.elasticsearch.search.Scroll; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.aggregations.InternalAggregation; -import org.elasticsearch.search.aggregations.InternalAggregations; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.collapse.CollapseBuilder; -import org.elasticsearch.search.internal.AliasFilter; -import org.elasticsearch.search.internal.InternalSearchResponse; -import org.elasticsearch.search.internal.SearchContext; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.NodeDisconnectedException; -import org.elasticsearch.transport.RemoteClusterConnectionTests; -import org.elasticsearch.transport.RemoteClusterService; -import org.elasticsearch.transport.RemoteClusterServiceTests; -import org.elasticsearch.transport.RemoteTransportException; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportConnectionListener; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.transport.TransportRequestOptions; -import org.elasticsearch.transport.TransportService; +import org.opensearch.search.Scroll; +import org.opensearch.search.SearchHit; +import org.opensearch.search.SearchHits; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.aggregations.InternalAggregation; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.AliasFilter; +import org.opensearch.search.internal.InternalSearchResponse; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.sort.SortBuilders; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.MockTransportService; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.NodeDisconnectedException; +import org.opensearch.transport.RemoteClusterConnectionTests; +import org.opensearch.transport.RemoteClusterService; +import org.opensearch.transport.RemoteClusterServiceTests; +import org.opensearch.transport.RemoteTransportException; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportConnectionListener; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportRequest; +import org.opensearch.transport.TransportRequestOptions; +import org.opensearch.transport.TransportService; import java.util.ArrayList; import java.util.Arrays; @@ -94,13 +94,13 @@ import java.util.function.BiFunction; import java.util.function.Function; -import static org.elasticsearch.test.InternalAggregationTestCase.emptyReduceContextBuilder; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.awaitLatch; +import static org.opensearch.test.InternalAggregationTestCase.emptyReduceContextBuilder; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.awaitLatch; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.startsWith; -public class TransportSearchActionTests extends ESTestCase { +public class TransportSearchActionTests extends OpenSearchTestCase { private final ThreadPool threadPool = new TestThreadPool(getClass().getName()); diff --git a/server/src/test/java/org/elasticsearch/action/search/TransportSearchHelperTests.java b/server/src/test/java/org/opensearch/action/search/TransportSearchHelperTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/search/TransportSearchHelperTests.java rename to server/src/test/java/org/opensearch/action/search/TransportSearchHelperTests.java index 2a5684b67f9c2..28b7fa88495cf 100644 --- a/server/src/test/java/org/elasticsearch/action/search/TransportSearchHelperTests.java +++ b/server/src/test/java/org/opensearch/action/search/TransportSearchHelperTests.java @@ -16,21 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.search; +package org.opensearch.action.search; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.search.SearchPhaseResult; -import org.elasticsearch.search.SearchShardTarget; -import org.elasticsearch.search.internal.ShardSearchContextId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.VersionUtils; +import org.opensearch.Version; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.index.shard.ShardId; +import org.opensearch.search.SearchPhaseResult; +import org.opensearch.search.SearchShardTarget; +import org.opensearch.search.internal.ShardSearchContextId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.VersionUtils; import static org.hamcrest.Matchers.equalTo; -public class TransportSearchHelperTests extends ESTestCase { +public class TransportSearchHelperTests extends OpenSearchTestCase { public static AtomicArray generateQueryResults() { AtomicArray array = new AtomicArray<>(3); diff --git a/server/src/test/java/org/elasticsearch/action/support/ActiveShardCountTests.java b/server/src/test/java/org/opensearch/action/support/ActiveShardCountTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/support/ActiveShardCountTests.java rename to server/src/test/java/org/opensearch/action/support/ActiveShardCountTests.java index 23a7c5050cc4a..70d668d827c6c 100644 --- a/server/src/test/java/org/elasticsearch/action/support/ActiveShardCountTests.java +++ b/server/src/test/java/org/opensearch/action/support/ActiveShardCountTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; import com.carrotsearch.hppc.cursors.ObjectCursor; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.routing.IndexRoutingTable; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.io.stream.ByteBufferStreamInput; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.Version; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.routing.IndexRoutingTable; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.common.UUIDs; +import org.opensearch.common.io.stream.ByteBufferStreamInput; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.support.ActiveShardCount; import java.io.IOException; @@ -42,7 +42,7 @@ /** * Tests for the {@link ActiveShardCount} class */ -public class ActiveShardCountTests extends ESTestCase { +public class ActiveShardCountTests extends OpenSearchTestCase { public void testFromIntValue() { assertSame(ActiveShardCount.from(0), ActiveShardCount.NONE); diff --git a/server/src/test/java/org/elasticsearch/action/support/AdapterActionFutureTests.java b/server/src/test/java/org/opensearch/action/support/AdapterActionFutureTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/support/AdapterActionFutureTests.java rename to server/src/test/java/org/opensearch/action/support/AdapterActionFutureTests.java index 894b9c621c6f7..b35c65723805e 100644 --- a/server/src/test/java/org/elasticsearch/action/support/AdapterActionFutureTests.java +++ b/server/src/test/java/org/opensearch/action/support/AdapterActionFutureTests.java @@ -17,13 +17,13 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.UncategorizedExecutionException; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.transport.RemoteTransportException; +import org.opensearch.OpenSearchException; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.UncategorizedExecutionException; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.transport.RemoteTransportException; import org.opensearch.action.support.AdapterActionFuture; import java.util.Objects; @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -public class AdapterActionFutureTests extends ESTestCase { +public class AdapterActionFutureTests extends OpenSearchTestCase { public void testInterruption() throws Exception { final AdapterActionFuture adapter = diff --git a/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java b/server/src/test/java/org/opensearch/action/support/AutoCreateIndexTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java rename to server/src/test/java/org/opensearch/action/support/AutoCreateIndexTests.java index 77b750639933b..5d3f5db2b1376 100644 --- a/server/src/test/java/org/elasticsearch/action/support/AutoCreateIndexTests.java +++ b/server/src/test/java/org/opensearch/action/support/AutoCreateIndexTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.action.support; - -import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.settings.ClusterSettings; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.indices.SystemIndexDescriptor; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.test.ESTestCase; +package org.opensearch.action.support; + +import org.opensearch.Version; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.settings.ClusterSettings; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.indices.SystemIndexDescriptor; +import org.opensearch.indices.SystemIndices; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.support.AutoCreateIndex; import java.util.HashMap; @@ -41,7 +41,7 @@ import static org.hamcrest.CoreMatchers.equalTo; -public class AutoCreateIndexTests extends ESTestCase { +public class AutoCreateIndexTests extends OpenSearchTestCase { private static final String TEST_SYSTEM_INDEX_NAME = ".test-system-index"; @@ -198,7 +198,7 @@ public void testUpdate() { ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); AutoCreateIndex autoCreateIndex = new AutoCreateIndex(settings, clusterSettings, new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), - new SystemIndices(org.elasticsearch.common.collect.Map.of())); + new SystemIndices(org.opensearch.common.collect.Map.of())); assertThat(autoCreateIndex.getAutoCreate().isAutoCreateIndex(), equalTo(value)); Settings newSettings = Settings.builder().put(AutoCreateIndex.AUTO_CREATE_INDEX_SETTING.getKey(), !value).build(); @@ -217,13 +217,13 @@ private static ClusterState buildClusterState(String... indices) { for (String index : indices) { metadata.put(IndexMetadata.builder(index).settings(settings(Version.CURRENT)).numberOfShards(1).numberOfReplicas(1)); } - return ClusterState.builder(org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)) + return ClusterState.builder(org.opensearch.cluster.ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)) .metadata(metadata).build(); } private AutoCreateIndex newAutoCreateIndex(Settings settings) { - SystemIndices systemIndices = new SystemIndices(org.elasticsearch.common.collect.Map.of("plugin", - org.elasticsearch.common.collect.List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME, "")))); + SystemIndices systemIndices = new SystemIndices(org.opensearch.common.collect.Map.of("plugin", + org.opensearch.common.collect.List.of(new SystemIndexDescriptor(TEST_SYSTEM_INDEX_NAME, "")))); return new AutoCreateIndex(settings, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), systemIndices); } diff --git a/server/src/test/java/org/elasticsearch/action/support/ContextPreservingActionListenerTests.java b/server/src/test/java/org/opensearch/action/support/ContextPreservingActionListenerTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/support/ContextPreservingActionListenerTests.java rename to server/src/test/java/org/opensearch/action/support/ContextPreservingActionListenerTests.java index a2b6e8aa759e4..3adbd5f39ed92 100644 --- a/server/src/test/java/org/elasticsearch/action/support/ContextPreservingActionListenerTests.java +++ b/server/src/test/java/org/opensearch/action/support/ContextPreservingActionListenerTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; import org.opensearch.action.ActionListener; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.support.ContextPreservingActionListener; import java.io.IOException; @@ -29,7 +29,7 @@ import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; -public class ContextPreservingActionListenerTests extends ESTestCase { +public class ContextPreservingActionListenerTests extends OpenSearchTestCase { public void testOriginalContextIsPreservedAfterOnResponse() throws IOException { ThreadContext threadContext = new ThreadContext(Settings.EMPTY); diff --git a/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java b/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java rename to server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java index ca5241d5e38e3..8eec4f07db65c 100644 --- a/server/src/test/java/org/elasticsearch/action/support/DefaultShardOperationFailedExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/support/DefaultShardOperationFailedExceptionTests.java @@ -17,29 +17,29 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexFormatTooNewException; import org.apache.lucene.index.IndexFormatTooOldException; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.LockObtainFailedException; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.action.support.broadcast.BroadcastShardOperationFailedException; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.xcontent.XContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.OpenSearchException; +import org.opensearch.action.support.broadcast.BroadcastShardOperationFailedException; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.common.xcontent.XContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; import org.opensearch.action.support.DefaultShardOperationFailedException; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import java.io.EOFException; import java.io.FileNotFoundException; @@ -48,7 +48,7 @@ import static org.hamcrest.Matchers.equalTo; -public class DefaultShardOperationFailedExceptionTests extends ESTestCase { +public class DefaultShardOperationFailedExceptionTests extends OpenSearchTestCase { public void testToString() { { diff --git a/server/src/test/java/org/elasticsearch/action/support/GroupedActionListenerTests.java b/server/src/test/java/org/opensearch/action/support/GroupedActionListenerTests.java similarity index 97% rename from server/src/test/java/org/elasticsearch/action/support/GroupedActionListenerTests.java rename to server/src/test/java/org/opensearch/action/support/GroupedActionListenerTests.java index 45e5c8a476a54..80af584cbdbd0 100644 --- a/server/src/test/java/org/elasticsearch/action/support/GroupedActionListenerTests.java +++ b/server/src/test/java/org/opensearch/action/support/GroupedActionListenerTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; import org.opensearch.action.ActionListener; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.support.GroupedActionListener; import java.io.IOException; @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; -public class GroupedActionListenerTests extends ESTestCase { +public class GroupedActionListenerTests extends OpenSearchTestCase { public void testNotifications() throws InterruptedException { AtomicReference> resRef = new AtomicReference<>(); diff --git a/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java b/server/src/test/java/org/opensearch/action/support/IndicesOptionsTests.java similarity index 96% rename from server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java rename to server/src/test/java/org/opensearch/action/support/IndicesOptionsTests.java index 6c4c97deb8b04..4cf7f5546c8a5 100644 --- a/server/src/test/java/org/elasticsearch/action/support/IndicesOptionsTests.java +++ b/server/src/test/java/org/opensearch/action/support/IndicesOptionsTests.java @@ -17,23 +17,23 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.support.IndicesOptions; import org.opensearch.action.support.IndicesOptions.Option; import org.opensearch.action.support.IndicesOptions.WildcardStates; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.ToXContent.MapParams; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.EqualsHashCodeTestUtils; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.ToXContent.MapParams; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.EqualsHashCodeTestUtils; import java.io.IOException; import java.util.ArrayList; @@ -46,11 +46,11 @@ import java.util.Map; import java.util.OptionalInt; -import static org.elasticsearch.test.VersionUtils.randomVersionBetween; +import static org.opensearch.test.VersionUtils.randomVersionBetween; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.is; -public class IndicesOptionsTests extends ESTestCase { +public class IndicesOptionsTests extends OpenSearchTestCase { public void testSerialization() throws Exception { int iterations = randomIntBetween(5, 20); diff --git a/server/src/test/java/org/elasticsearch/action/support/ListenableActionFutureTests.java b/server/src/test/java/org/opensearch/action/support/ListenableActionFutureTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/support/ListenableActionFutureTests.java rename to server/src/test/java/org/opensearch/action/support/ListenableActionFutureTests.java index 28a39d110577f..b0c21457a2e62 100644 --- a/server/src/test/java/org/elasticsearch/action/support/ListenableActionFutureTests.java +++ b/server/src/test/java/org/opensearch/action/support/ListenableActionFutureTests.java @@ -16,21 +16,21 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; import org.opensearch.action.ActionListener; -import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transports; +import org.opensearch.common.util.concurrent.AbstractRunnable; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transports; import org.opensearch.action.support.PlainListenableActionFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -public class ListenableActionFutureTests extends ESTestCase { +public class ListenableActionFutureTests extends OpenSearchTestCase { public void testListenerIsCallableFromNetworkThreads() throws Throwable { ThreadPool threadPool = new TestThreadPool("testListenerIsCallableFromNetworkThreads"); diff --git a/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java b/server/src/test/java/org/opensearch/action/support/ListenerTimeoutsTests.java similarity index 90% rename from server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java rename to server/src/test/java/org/opensearch/action/support/ListenerTimeoutsTests.java index 2bb3ee7f3e2b1..aa511ddf3ea52 100644 --- a/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java +++ b/server/src/test/java/org/opensearch/action/support/ListenerTimeoutsTests.java @@ -17,15 +17,15 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.OpenSearchTimeoutException; +import org.opensearch.OpenSearchTimeoutException; import org.opensearch.action.ActionListener; -import org.elasticsearch.cluster.coordination.DeterministicTaskQueue; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.cluster.coordination.DeterministicTaskQueue; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.ThreadPool; import org.junit.Before; import org.opensearch.action.support.ListenerTimeouts; @@ -33,10 +33,10 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; -import static org.elasticsearch.node.Node.NODE_NAME_SETTING; +import static org.opensearch.node.Node.NODE_NAME_SETTING; import static org.hamcrest.core.IsInstanceOf.instanceOf; -public class ListenerTimeoutsTests extends ESTestCase { +public class ListenerTimeoutsTests extends OpenSearchTestCase { private final TimeValue timeout = TimeValue.timeValueMillis(10); private final String generic = ThreadPool.Names.GENERIC; diff --git a/server/src/test/java/org/elasticsearch/action/support/RefreshPolicyTests.java b/server/src/test/java/org/opensearch/action/support/RefreshPolicyTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/support/RefreshPolicyTests.java rename to server/src/test/java/org/opensearch/action/support/RefreshPolicyTests.java index 4d63a34789abf..ca90f9f4b66bc 100644 --- a/server/src/test/java/org/elasticsearch/action/support/RefreshPolicyTests.java +++ b/server/src/test/java/org/opensearch/action/support/RefreshPolicyTests.java @@ -17,16 +17,16 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.common.io.stream.BytesStreamOutput; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.test.OpenSearchTestCase; import org.opensearch.action.support.WriteRequest; import java.io.IOException; -public class RefreshPolicyTests extends ESTestCase { +public class RefreshPolicyTests extends OpenSearchTestCase { public void testSerialization() throws IOException { final WriteRequest.RefreshPolicy refreshPolicy = randomFrom(WriteRequest.RefreshPolicy.values()); diff --git a/server/src/test/java/org/elasticsearch/action/support/RetryableActionTests.java b/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/support/RetryableActionTests.java rename to server/src/test/java/org/opensearch/action/support/RetryableActionTests.java index 2c5d7c44b233d..4bc72574dff46 100644 --- a/server/src/test/java/org/elasticsearch/action/support/RetryableActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/RetryableActionTests.java @@ -17,25 +17,25 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.ActionListener; -import org.elasticsearch.cluster.coordination.DeterministicTaskQueue; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.cluster.coordination.DeterministicTaskQueue; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.test.OpenSearchTestCase; import org.junit.Before; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.action.support.RetryableAction; import java.util.concurrent.atomic.AtomicInteger; -import static org.elasticsearch.node.Node.NODE_NAME_SETTING; +import static org.opensearch.node.Node.NODE_NAME_SETTING; import static org.hamcrest.Matchers.lessThanOrEqualTo; -public class RetryableActionTests extends ESTestCase { +public class RetryableActionTests extends OpenSearchTestCase { private DeterministicTaskQueue taskQueue; diff --git a/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java b/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java rename to server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java index d5217d5db2f4d..2fffcc4e62853 100644 --- a/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java +++ b/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.support; +package org.opensearch.action.support; -import org.elasticsearch.OpenSearchTimeoutException; +import org.opensearch.OpenSearchTimeoutException; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.ActionResponse; import org.opensearch.action.LatchedActionListener; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.node.Node; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.ThreadPool; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.settings.Settings; +import org.opensearch.node.Node; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; import org.opensearch.action.support.ActionFilter; @@ -57,7 +57,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.notNullValue; -public class TransportActionFilterChainTests extends ESTestCase { +public class TransportActionFilterChainTests extends OpenSearchTestCase { private AtomicInteger counter; private ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java b/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java rename to server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java index d9384eafa2eee..0c45fb84817d5 100644 --- a/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java @@ -17,50 +17,50 @@ * under the License. */ -package org.elasticsearch.action.support.broadcast.node; +package org.opensearch.action.support.broadcast.node; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchException; +import org.opensearch.Version; import org.opensearch.action.IndicesRequest; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.DefaultShardOperationFailedException; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.broadcast.BroadcastRequest; -import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.action.support.broadcast.BroadcastShardOperationFailedException; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockException; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.IndexRoutingTable; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.ShardsIterator; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.action.support.broadcast.BroadcastRequest; +import org.opensearch.action.support.broadcast.BroadcastResponse; +import org.opensearch.action.support.broadcast.BroadcastShardOperationFailedException; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockException; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.IndexRoutingTable; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.ShardsIterator; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TestTransportChannel; -import org.elasticsearch.transport.TransportResponse; -import org.elasticsearch.transport.TransportService; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TestTransportChannel; +import org.opensearch.transport.TransportResponse; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -79,13 +79,13 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.object.HasToString.hasToString; -public class TransportBroadcastByNodeActionTests extends ESTestCase { +public class TransportBroadcastByNodeActionTests extends OpenSearchTestCase { private static final String TEST_INDEX = "test-index"; private static final String TEST_CLUSTER = "test-cluster"; diff --git a/server/src/test/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponseTests.java b/server/src/test/java/org/opensearch/action/support/master/ShardsAcknowledgedResponseTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponseTests.java rename to server/src/test/java/org/opensearch/action/support/master/ShardsAcknowledgedResponseTests.java index 45108a515dc41..c48a69504579d 100644 --- a/server/src/test/java/org/elasticsearch/action/support/master/ShardsAcknowledgedResponseTests.java +++ b/server/src/test/java/org/opensearch/action/support/master/ShardsAcknowledgedResponseTests.java @@ -16,20 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support.master; +package org.opensearch.action.support.master; -import org.elasticsearch.Version; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.test.ESTestCase; +import org.opensearch.Version; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; import java.util.Collections; import static org.hamcrest.Matchers.is; -public class ShardsAcknowledgedResponseTests extends ESTestCase { +public class ShardsAcknowledgedResponseTests extends OpenSearchTestCase { public void testSerialization() throws Exception { ShardsAcknowledgedResponse testInstance = new TestImpl(true, true); diff --git a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java b/server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java rename to server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionTests.java index 8ddba7ad8a290..45dcb4ac585a0 100644 --- a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support.master; +package org.opensearch.action.support.master; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchException; +import org.opensearch.Version; import org.opensearch.action.ActionFuture; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionRequestValidationException; @@ -27,34 +27,34 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.action.support.ThreadedActionListener; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.NotMasterException; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockException; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.coordination.FailedToCommitClusterStateException; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.discovery.MasterNotDiscoveredException; -import org.elasticsearch.node.NodeClosedException; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.NotMasterException; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockException; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.coordination.FailedToCommitClusterStateException; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.discovery.MasterNotDiscoveredException; +import org.opensearch.node.NodeClosedException; import org.opensearch.rest.RestStatus; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.ConnectTransportException; -import org.elasticsearch.transport.TransportService; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.ConnectTransportException; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -68,12 +68,12 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -public class TransportMasterNodeActionTests extends ESTestCase { +public class TransportMasterNodeActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; private ClusterService clusterService; diff --git a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionUtils.java b/server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionUtils.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionUtils.java rename to server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionUtils.java index 4f3127a6be739..79722511f41ff 100644 --- a/server/src/test/java/org/elasticsearch/action/support/master/TransportMasterNodeActionUtils.java +++ b/server/src/test/java/org/opensearch/action/support/master/TransportMasterNodeActionUtils.java @@ -17,11 +17,11 @@ * under the License. */ -package org.elasticsearch.action.support.master; +package org.opensearch.action.support.master; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionResponse; -import org.elasticsearch.cluster.ClusterState; +import org.opensearch.cluster.ClusterState; public class TransportMasterNodeActionUtils { diff --git a/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java b/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java rename to server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java index 5cb765d243e99..70b320529a00b 100644 --- a/server/src/test/java/org/elasticsearch/action/support/nodes/TransportNodesActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java @@ -17,27 +17,27 @@ * under the License. */ -package org.elasticsearch.action.support.nodes; +package org.opensearch.action.support.nodes; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.FailedNodeException; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeActionTests; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.broadcast.node.TransportBroadcastByNodeActionTests; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -55,11 +55,11 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.function.Supplier; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.mockito.Mockito.mock; -public class TransportNodesActionTests extends ESTestCase { +public class TransportNodesActionTests extends OpenSearchTestCase { private static ThreadPool THREAD_POOL; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/BroadcastReplicationTests.java b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java similarity index 86% rename from server/src/test/java/org/elasticsearch/action/support/replication/BroadcastReplicationTests.java rename to server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java index b1e7a33f55e01..b2b2542305d34 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/BroadcastReplicationTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.NoShardAvailableActionException; import org.opensearch.action.UnavailableShardsException; @@ -26,34 +26,34 @@ import org.opensearch.action.admin.indices.flush.FlushResponse; import org.opensearch.action.admin.indices.flush.TransportFlushAction; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.DefaultShardOperationFailedException; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.broadcast.BroadcastRequest; -import org.elasticsearch.action.support.broadcast.BroadcastResponse; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.network.NetworkService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.core.internal.io.IOUtils; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.breaker.CircuitBreakerService; -import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; +import org.opensearch.action.support.broadcast.BroadcastRequest; +import org.opensearch.action.support.broadcast.BroadcastResponse; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.network.NetworkService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.PageCacheRecycler; +import org.opensearch.common.util.concurrent.ConcurrentCollections; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.breaker.CircuitBreakerService; +import org.opensearch.indices.breaker.NoneCircuitBreakerService; import org.opensearch.rest.RestStatus; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportService; -import org.elasticsearch.transport.nio.MockNioTransport; +import org.opensearch.tasks.Task; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportService; +import org.opensearch.transport.nio.MockNioTransport; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -68,16 +68,16 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.state; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.stateWithAssignedPrimariesAndOneReplica; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.stateWithNoShard; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.state; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.stateWithAssignedPrimariesAndOneReplica; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.stateWithNoShard; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.lessThanOrEqualTo; -public class BroadcastReplicationTests extends ESTestCase { +public class BroadcastReplicationTests extends OpenSearchTestCase { private static ThreadPool threadPool; private static CircuitBreakerService circuitBreakerService; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/PendingReplicationActionsTests.java b/server/src/test/java/org/opensearch/action/support/replication/PendingReplicationActionsTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/support/replication/PendingReplicationActionsTests.java rename to server/src/test/java/org/opensearch/action/support/replication/PendingReplicationActionsTests.java index d76dba057b156..6034eb7741ae1 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/PendingReplicationActionsTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/PendingReplicationActionsTests.java @@ -17,21 +17,21 @@ * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; import org.opensearch.action.ActionListener; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.action.support.RetryableAction; -import org.elasticsearch.common.UUIDs; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.shard.IndexShardClosedException; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; +import org.opensearch.common.UUIDs; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.index.shard.IndexShardClosedException; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; import java.util.Collections; -public class PendingReplicationActionsTests extends ESTestCase { +public class PendingReplicationActionsTests extends OpenSearchTestCase { private TestThreadPool threadPool; private ShardId shardId; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationOperationTests.java b/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/support/replication/ReplicationOperationTests.java rename to server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java index 1d8cc03f1305e..39e15a0c4e3af 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationOperationTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/ReplicationOperationTests.java @@ -16,43 +16,43 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; import org.apache.logging.log4j.Logger; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.store.AlreadyClosedException; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.UnavailableShardsException; import org.opensearch.action.support.ActiveShardCount; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.CircuitBreakingException; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.common.util.set.Sets; -import org.elasticsearch.index.shard.IndexShardNotStartedException; -import org.elasticsearch.index.shard.IndexShardState; -import org.elasticsearch.index.shard.ReplicationGroup; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.node.NodeClosedException; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.ConnectTransportException; -import org.elasticsearch.transport.RemoteTransportException; -import org.elasticsearch.transport.SendRequestTransportException; +import org.opensearch.action.support.replication.ReplicationResponse.ShardInfo; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.CircuitBreakingException; +import org.opensearch.common.transport.TransportAddress; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ConcurrentCollections; +import org.opensearch.common.util.concurrent.EsRejectedExecutionException; +import org.opensearch.common.util.set.Sets; +import org.opensearch.index.shard.IndexShardNotStartedException; +import org.opensearch.index.shard.IndexShardState; +import org.opensearch.index.shard.ReplicationGroup; +import org.opensearch.index.shard.ShardId; +import org.opensearch.node.NodeClosedException; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.ConnectTransportException; +import org.opensearch.transport.RemoteTransportException; +import org.opensearch.transport.SendRequestTransportException; import java.net.InetAddress; import java.util.ArrayList; @@ -68,15 +68,15 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.state; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.stateWithActivePrimary; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.state; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.stateWithActivePrimary; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class ReplicationOperationTests extends ESTestCase { +public class ReplicationOperationTests extends OpenSearchTestCase { private ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java b/server/src/test/java/org/opensearch/action/support/replication/ReplicationResponseTests.java similarity index 84% rename from server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java rename to server/src/test/java/org/opensearch/action/support/replication/ReplicationResponseTests.java index 735cc3aa02203..c2ec611a88f14 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/ReplicationResponseTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/ReplicationResponseTests.java @@ -17,31 +17,31 @@ * under the License. */ -package org.elasticsearch.action.support.replication; - -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.action.support.replication.ReplicationResponse.ShardInfo; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.breaker.CircuitBreaker; -import org.elasticsearch.common.breaker.CircuitBreakingException; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.shard.ShardId; +package org.opensearch.action.support.replication; + +import org.opensearch.OpenSearchException; +import org.opensearch.action.support.replication.ReplicationResponse.ShardInfo; +import org.opensearch.common.Strings; +import org.opensearch.common.breaker.CircuitBreaker; +import org.opensearch.common.breaker.CircuitBreakingException; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.shard.ShardId; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.Locale; -import static org.elasticsearch.ElasticsearchExceptionTests.assertDeepEquals; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.OpenSearchExceptionTests.assertDeepEquals; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; -public class ReplicationResponseTests extends ESTestCase { +public class ReplicationResponseTests extends OpenSearchTestCase { public void testShardInfoToString() { final int total = 5; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationActionTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java similarity index 94% rename from server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationActionTests.java rename to server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java index 8895e59cfe51b..6bba2d8049003 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java @@ -17,75 +17,75 @@ * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; import org.apache.lucene.store.AlreadyClosedException; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.Version; +import org.opensearch.OpenSearchException; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.UnavailableShardsException; import org.opensearch.action.admin.indices.close.CloseIndexRequest; import org.opensearch.action.admin.indices.create.CreateIndexRequest; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.ActiveShardCount; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.replication.ReplicationOperation.ReplicaResponse; -import org.elasticsearch.client.transport.NoNodeAvailableException; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.ESAllocationTestCase; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockException; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.AllocationId; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.RoutingNode; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.cluster.routing.allocation.AllocationService; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.Nullable; -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.network.NetworkService; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.PageCacheRecycler; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.IndexShardClosedException; -import org.elasticsearch.index.shard.IndexShardState; -import org.elasticsearch.index.shard.ReplicationGroup; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.shard.ShardNotFoundException; -import org.elasticsearch.index.shard.ShardNotInPrimaryModeException; -import org.elasticsearch.indices.IndexClosedException; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; -import org.elasticsearch.indices.cluster.ClusterStateChanges; +import org.opensearch.action.support.replication.ReplicationOperation.ReplicaResponse; +import org.opensearch.client.transport.NoNodeAvailableException; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.OpenSearchAllocationTestCase; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockException; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.AllocationId; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.RoutingNode; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.cluster.routing.allocation.AllocationService; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.Nullable; +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.network.NetworkService; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.PageCacheRecycler; +import org.opensearch.index.Index; +import org.opensearch.index.IndexNotFoundException; +import org.opensearch.index.IndexService; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardClosedException; +import org.opensearch.index.shard.IndexShardState; +import org.opensearch.index.shard.ReplicationGroup; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.shard.ShardNotFoundException; +import org.opensearch.index.shard.ShardNotInPrimaryModeException; +import org.opensearch.indices.IndexClosedException; +import org.opensearch.indices.IndicesService; +import org.opensearch.indices.breaker.NoneCircuitBreakerService; +import org.opensearch.indices.cluster.ClusterStateChanges; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.test.transport.MockTransportService; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TestTransportChannel; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportChannel; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.transport.TransportResponse; -import org.elasticsearch.transport.TransportService; -import org.elasticsearch.transport.nio.MockNioTransport; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.test.transport.MockTransportService; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TestTransportChannel; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportChannel; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportRequest; +import org.opensearch.transport.TransportResponse; +import org.opensearch.transport.TransportService; +import org.opensearch.transport.nio.MockNioTransport; import org.hamcrest.Matcher; import org.junit.After; import org.junit.AfterClass; @@ -108,11 +108,11 @@ import java.util.stream.Collectors; import static java.util.Collections.singleton; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.state; -import static org.elasticsearch.action.support.replication.ClusterStateCreationUtils.stateWithActivePrimary; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_WAIT_FOR_ACTIVE_SHARDS; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.state; +import static org.opensearch.action.support.replication.ClusterStateCreationUtils.stateWithActivePrimary; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_WAIT_FOR_ACTIVE_SHARDS; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; @@ -133,7 +133,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class TransportReplicationActionTests extends ESTestCase { +public class TransportReplicationActionTests extends OpenSearchTestCase { private static final ShardId NO_SHARD_ID = null; @@ -1047,7 +1047,7 @@ public void testReplicaActionRejectsWrongAid() throws Exception { } /** - * test throwing a {@link org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException} + * test throwing a {@link org.opensearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException} * causes a retry */ public void testRetryOnReplica() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java similarity index 91% rename from server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java rename to server/src/test/java/org/opensearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java index 3e2b751f87841..98a3cc34d5272 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationAllPermitsAcquisitionTests.java @@ -16,49 +16,49 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockException; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodeRole; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.cluster.routing.IndexRoutingTable; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.RecoverySource; -import org.elasticsearch.cluster.routing.RoutingTable; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.engine.InternalEngineFactory; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.IndexShardTestCase; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.IndicesService; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockException; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.node.DiscoveryNodeRole; +import org.opensearch.cluster.node.DiscoveryNodes; +import org.opensearch.cluster.routing.IndexRoutingTable; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.RecoverySource; +import org.opensearch.cluster.routing.RoutingTable; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.index.IndexService; +import org.opensearch.index.engine.InternalEngineFactory; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.IndicesService; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.transport.MockTransport; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportMessageListener; -import org.elasticsearch.transport.TransportRequest; -import org.elasticsearch.transport.TransportResponseHandler; -import org.elasticsearch.transport.TransportService; +import org.opensearch.test.transport.MockTransport; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportMessageListener; +import org.opensearch.transport.TransportRequest; +import org.opensearch.transport.TransportResponseHandler; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.Before; @@ -75,14 +75,14 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_CREATION_DATE; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_INDEX_UUID; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_VERSION_CREATED; -import static org.elasticsearch.cluster.routing.TestShardRouting.newShardRouting; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_CREATION_DATE; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_INDEX_UUID; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_VERSION_CREATED; +import static org.opensearch.cluster.routing.TestShardRouting.newShardRouting; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; diff --git a/server/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java similarity index 92% rename from server/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java rename to server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java index 83546417f191f..0f05849bb4392 100644 --- a/server/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java @@ -17,48 +17,48 @@ * under the License. */ -package org.elasticsearch.action.support.replication; +package org.opensearch.action.support.replication; -import org.elasticsearch.OpenSearchException; +import org.opensearch.OpenSearchException; import org.opensearch.action.ActionListener; -import org.elasticsearch.index.IndexingPressure; +import org.opensearch.index.IndexingPressure; import org.opensearch.action.support.ActionFilters; -import org.elasticsearch.action.support.ActionTestUtils; +import org.opensearch.action.support.ActionTestUtils; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.action.support.WriteRequest.RefreshPolicy; import org.opensearch.action.support.WriteResponse; -import org.elasticsearch.action.support.replication.ReplicationOperation.ReplicaResponse; -import org.elasticsearch.client.transport.NoNodeAvailableException; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.action.shard.ShardStateAction; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.routing.IndexShardRoutingTable; -import org.elasticsearch.cluster.routing.RoutingNode; -import org.elasticsearch.cluster.routing.ShardRouting; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.routing.TestShardRouting; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.lease.Releasable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.shard.IndexShard; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.shard.ShardNotFoundException; -import org.elasticsearch.index.translog.Translog; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.indices.SystemIndices; -import org.elasticsearch.node.NodeClosedException; -import org.elasticsearch.test.ClusterServiceUtils; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportResponse; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.support.replication.ReplicationOperation.ReplicaResponse; +import org.opensearch.client.transport.NoNodeAvailableException; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.action.shard.ShardStateAction; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.routing.IndexShardRoutingTable; +import org.opensearch.cluster.routing.RoutingNode; +import org.opensearch.cluster.routing.ShardRouting; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.routing.TestShardRouting; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.lease.Releasable; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.Index; +import org.opensearch.index.IndexService; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.ShardId; +import org.opensearch.index.shard.ShardNotFoundException; +import org.opensearch.index.translog.Translog; +import org.opensearch.indices.IndicesService; +import org.opensearch.indices.SystemIndices; +import org.opensearch.node.NodeClosedException; +import org.opensearch.test.ClusterServiceUtils; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportResponse; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -78,7 +78,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptyMap; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; @@ -94,7 +94,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class TransportWriteActionTests extends ESTestCase { +public class TransportWriteActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; diff --git a/server/src/test/java/org/elasticsearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java b/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java similarity index 89% rename from server/src/test/java/org/elasticsearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java rename to server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java index 2974fe1c632bb..1777a46cfaaa8 100644 --- a/server/src/test/java/org/elasticsearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java @@ -17,40 +17,40 @@ * under the License. */ -package org.elasticsearch.action.support.single.instance; +package org.opensearch.action.support.single.instance; -import org.elasticsearch.ExceptionsHelper; +import org.opensearch.ExceptionsHelper; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionResponse; import org.opensearch.action.IndicesRequest; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.PlainActionFuture; -import org.elasticsearch.action.support.replication.ClusterStateCreationUtils; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.block.ClusterBlock; -import org.elasticsearch.cluster.block.ClusterBlockException; -import org.elasticsearch.cluster.block.ClusterBlockLevel; -import org.elasticsearch.cluster.block.ClusterBlocks; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.ShardIterator; -import org.elasticsearch.cluster.routing.ShardRoutingState; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.index.shard.ShardId; +import org.opensearch.action.support.replication.ClusterStateCreationUtils; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.block.ClusterBlock; +import org.opensearch.cluster.block.ClusterBlockException; +import org.opensearch.cluster.block.ClusterBlockLevel; +import org.opensearch.cluster.block.ClusterBlocks; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.ShardIterator; +import org.opensearch.cluster.routing.ShardRoutingState; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.index.shard.ShardId; import org.opensearch.rest.RestStatus; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.transport.CapturingTransport; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.ConnectTransportException; -import org.elasticsearch.transport.TransportException; -import org.elasticsearch.transport.TransportService; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.transport.CapturingTransport; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.ConnectTransportException; +import org.opensearch.transport.TransportException; +import org.opensearch.transport.TransportService; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -65,11 +65,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import static org.elasticsearch.test.ClusterServiceUtils.createClusterService; -import static org.elasticsearch.test.ClusterServiceUtils.setState; +import static org.opensearch.test.ClusterServiceUtils.createClusterService; +import static org.opensearch.test.ClusterServiceUtils.setState; import static org.hamcrest.core.IsEqual.equalTo; -public class TransportInstanceSingleOperationActionTests extends ESTestCase { +public class TransportInstanceSingleOperationActionTests extends OpenSearchTestCase { private static ThreadPool THREAD_POOL; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java b/server/src/test/java/org/opensearch/action/termvectors/AbstractTermVectorsTestCase.java similarity index 97% rename from server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java rename to server/src/test/java/org/opensearch/action/termvectors/AbstractTermVectorsTestCase.java index c5a7e0c02190b..5349932f82fdb 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/AbstractTermVectorsTestCase.java +++ b/server/src/test/java/org/opensearch/action/termvectors/AbstractTermVectorsTestCase.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.termvectors; +package org.opensearch.action.termvectors; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; @@ -48,9 +48,9 @@ import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.Directory; import org.opensearch.action.admin.indices.alias.Alias; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.test.ESIntegTestCase; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.test.ESIntegTestCase; import java.io.IOException; import java.util.ArrayList; @@ -60,8 +60,8 @@ import java.util.Locale; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; import static org.hamcrest.Matchers.equalTo; public abstract class AbstractTermVectorsTestCase extends ESIntegTestCase { @@ -275,7 +275,7 @@ protected TestConfig[] generateTestConfigs(int numberOfTests, TestDoc[] testDocs configs.add(new TestConfig(new TestDoc("doesnt_exist", new TestFieldSetting[]{}, new String[]{}) .index("doesn't_exist").alias("doesn't_exist"), new String[]{"doesnt_exist"}, true, true, true) - .expectedException(org.elasticsearch.index.IndexNotFoundException.class)); + .expectedException(org.opensearch.index.IndexNotFoundException.class)); refresh(); diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java b/server/src/test/java/org/opensearch/action/termvectors/GetTermVectorsTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java rename to server/src/test/java/org/opensearch/action/termvectors/GetTermVectorsTests.java index 85574a646187b..4da6baf437ba7 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/GetTermVectorsTests.java +++ b/server/src/test/java/org/opensearch/action/termvectors/GetTermVectorsTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.action.termvectors; +package org.opensearch.action.termvectors; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.analysis.TokenFilter; @@ -33,15 +33,15 @@ import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.analysis.PreConfiguredTokenizer; -import org.elasticsearch.index.analysis.TokenFilterFactory; -import org.elasticsearch.indices.analysis.AnalysisModule; -import org.elasticsearch.plugins.AnalysisPlugin; -import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.test.ESSingleNodeTestCase; +import org.opensearch.OpenSearchException; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.index.analysis.PreConfiguredTokenizer; +import org.opensearch.index.analysis.TokenFilterFactory; +import org.opensearch.indices.analysis.AnalysisModule; +import org.opensearch.plugins.AnalysisPlugin; +import org.opensearch.plugins.Plugin; +import org.opensearch.test.OpenSearchSingleNodeTestCase; import java.io.IOException; import java.util.ArrayList; @@ -51,7 +51,7 @@ import java.util.List; import java.util.Map; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java b/server/src/test/java/org/opensearch/action/termvectors/TermVectorsUnitTests.java similarity index 95% rename from server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java rename to server/src/test/java/org/opensearch/action/termvectors/TermVectorsUnitTests.java index 4ab7d74379dde..fb77760881890 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java +++ b/server/src/test/java/org/opensearch/action/termvectors/TermVectorsUnitTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.action.termvectors; +package org.opensearch.action.termvectors; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; @@ -36,17 +36,17 @@ import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory; -import org.elasticsearch.action.termvectors.TermVectorsRequest.Flag; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.io.stream.InputStreamStreamInput; -import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.opensearch.action.termvectors.TermVectorsRequest.Flag; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.io.stream.InputStreamStreamInput; +import org.opensearch.common.io.stream.OutputStreamStreamOutput; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.rest.action.document.RestTermVectorsAction; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.StreamsUtils; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.StreamsUtils; import org.hamcrest.Matchers; import java.io.ByteArrayInputStream; @@ -59,7 +59,7 @@ import static org.hamcrest.Matchers.equalTo; -public class TermVectorsUnitTests extends ESTestCase { +public class TermVectorsUnitTests extends OpenSearchTestCase { public void testStreamResponse() throws Exception { TermVectorsResponse outResponse = new TermVectorsResponse("a", "b", "c"); outResponse.setExists(true); diff --git a/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java b/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java similarity index 85% rename from server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java rename to server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java index cd38b488034df..52cd03e53f0f8 100644 --- a/server/src/test/java/org/elasticsearch/action/termvectors/TransportMultiTermVectorsActionTests.java +++ b/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java @@ -17,42 +17,42 @@ * under the License. */ -package org.elasticsearch.action.termvectors; +package org.opensearch.action.termvectors; -import org.elasticsearch.Version; +import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.IndicesRequest; import org.opensearch.action.RoutingMissingException; -import org.elasticsearch.action.get.TransportMultiGetActionTests; -import org.elasticsearch.action.support.ActionFilters; -import org.elasticsearch.client.node.NodeClient; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.metadata.IndexMetadata; -import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.routing.OperationRouting; -import org.elasticsearch.cluster.routing.ShardIterator; -import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.concurrent.AtomicArray; -import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.indices.IndicesService; -import org.elasticsearch.tasks.Task; -import org.elasticsearch.tasks.TaskId; -import org.elasticsearch.tasks.TaskManager; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.threadpool.TestThreadPool; -import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.Transport; -import org.elasticsearch.transport.TransportService; +import org.opensearch.action.get.TransportMultiGetActionTests; +import org.opensearch.action.support.ActionFilters; +import org.opensearch.client.node.NodeClient; +import org.opensearch.cluster.ClusterName; +import org.opensearch.cluster.ClusterState; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.cluster.metadata.IndexNameExpressionResolver; +import org.opensearch.cluster.metadata.Metadata; +import org.opensearch.cluster.node.DiscoveryNode; +import org.opensearch.cluster.routing.OperationRouting; +import org.opensearch.cluster.routing.ShardIterator; +import org.opensearch.cluster.service.ClusterService; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.AtomicArray; +import org.opensearch.common.util.concurrent.ThreadContext; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.Index; +import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.IndicesService; +import org.opensearch.tasks.Task; +import org.opensearch.tasks.TaskId; +import org.opensearch.tasks.TaskManager; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.TestThreadPool; +import org.opensearch.threadpool.ThreadPool; +import org.opensearch.transport.Transport; +import org.opensearch.transport.TransportService; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -62,7 +62,7 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.elasticsearch.common.UUIDs.randomBase64UUID; +import static org.opensearch.common.UUIDs.randomBase64UUID; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.Matchers.anyString; @@ -70,7 +70,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public class TransportMultiTermVectorsActionTests extends ESTestCase { +public class TransportMultiTermVectorsActionTests extends OpenSearchTestCase { private static ThreadPool threadPool; private static TransportService transportService; diff --git a/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java b/server/src/test/java/org/opensearch/action/update/UpdateRequestTests.java similarity index 93% rename from server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java rename to server/src/test/java/org/opensearch/action/update/UpdateRequestTests.java index 2c5da92feaa78..2cd9f31b95402 100644 --- a/server/src/test/java/org/elasticsearch/action/update/UpdateRequestTests.java +++ b/server/src/test/java/org/opensearch/action/update/UpdateRequestTests.java @@ -17,37 +17,37 @@ * under the License. */ -package org.elasticsearch.action.update; +package org.opensearch.action.update; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.DocWriteResponse; -import org.elasticsearch.action.delete.DeleteRequest; -import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.action.support.replication.ReplicationRequest; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.common.xcontent.XContentParseException; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.env.Environment; -import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.script.MockScriptEngine; -import org.elasticsearch.script.Script; -import org.elasticsearch.script.ScriptEngine; -import org.elasticsearch.script.ScriptModule; -import org.elasticsearch.script.ScriptService; -import org.elasticsearch.script.ScriptType; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.action.delete.DeleteRequest; +import org.opensearch.action.index.IndexRequest; +import org.opensearch.action.support.replication.ReplicationRequest; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.document.DocumentField; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentFactory; +import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.common.xcontent.XContentParseException; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.env.Environment; +import org.opensearch.index.get.GetResult; +import org.opensearch.index.shard.ShardId; +import org.opensearch.script.MockScriptEngine; +import org.opensearch.script.Script; +import org.opensearch.script.ScriptEngine; +import org.opensearch.script.ScriptModule; +import org.opensearch.script.ScriptService; +import org.opensearch.script.ScriptType; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.RandomObjects; import org.junit.Before; import java.io.IOException; @@ -57,11 +57,11 @@ import java.util.function.Function; import static java.util.Collections.emptyMap; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; -import static org.elasticsearch.script.MockScriptEngine.mockInlineScript; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +import static org.opensearch.script.MockScriptEngine.mockInlineScript; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.nullValue; @@ -70,7 +70,7 @@ import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; -public class UpdateRequestTests extends ESTestCase { +public class UpdateRequestTests extends OpenSearchTestCase { private UpdateHelper updateHelper; @@ -423,7 +423,7 @@ private void runTimeoutTest(final GetResult getResult, final UpdateRequest updat new ShardId("test", "", 0), updateRequest, getResult, - ESTestCase::randomNonNegativeLong); + OpenSearchTestCase::randomNonNegativeLong); final Writeable action = result.action(); assertThat(action, instanceOf(ReplicationRequest.class)); final ReplicationRequest request = (ReplicationRequest) action; @@ -612,7 +612,7 @@ public void testUpdateScript() throws Exception { .script(mockInlineScript("ctx._source.body = \"foo\"")); UpdateHelper.Result result = updateHelper.prepareUpdateScriptRequest(shardId, request, getResult, - ESTestCase::randomNonNegativeLong); + OpenSearchTestCase::randomNonNegativeLong); assertThat(result.action(), instanceOf(IndexRequest.class)); assertThat(result.getResponseResult(), equalTo(DocWriteResponse.Result.UPDATED)); @@ -622,7 +622,7 @@ public void testUpdateScript() throws Exception { request = new UpdateRequest("test", "type1", "1").script(mockInlineScript("ctx.op = delete")); result = updateHelper.prepareUpdateScriptRequest(shardId, request, getResult, - ESTestCase::randomNonNegativeLong); + OpenSearchTestCase::randomNonNegativeLong); assertThat(result.action(), instanceOf(DeleteRequest.class)); assertThat(result.getResponseResult(), equalTo(DocWriteResponse.Result.DELETED)); @@ -636,7 +636,7 @@ public void testUpdateScript() throws Exception { } result = updateHelper.prepareUpdateScriptRequest(shardId, request, getResult, - ESTestCase::randomNonNegativeLong); + OpenSearchTestCase::randomNonNegativeLong); assertThat(result.action(), instanceOf(UpdateResponse.class)); assertThat(result.getResponseResult(), equalTo(DocWriteResponse.Result.NOOP)); diff --git a/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java b/server/src/test/java/org/opensearch/action/update/UpdateResponseTests.java similarity index 88% rename from server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java rename to server/src/test/java/org/opensearch/action/update/UpdateResponseTests.java index f9a4efe2b6b8a..1528a411ef579 100644 --- a/server/src/test/java/org/elasticsearch/action/update/UpdateResponseTests.java +++ b/server/src/test/java/org/opensearch/action/update/UpdateResponseTests.java @@ -17,25 +17,25 @@ * under the License. */ -package org.elasticsearch.action.update; +package org.opensearch.action.update; import org.opensearch.action.DocWriteResponse; -import org.elasticsearch.action.index.IndexResponseTests; -import org.elasticsearch.action.support.replication.ReplicationResponse; -import org.elasticsearch.common.Strings; -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.collect.Tuple; -import org.elasticsearch.common.document.DocumentField; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.index.get.GetResultTests; -import org.elasticsearch.index.seqno.SequenceNumbers; -import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.test.RandomObjects; +import org.opensearch.action.index.IndexResponseTests; +import org.opensearch.action.support.replication.ReplicationResponse; +import org.opensearch.common.Strings; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.collect.Tuple; +import org.opensearch.common.document.DocumentField; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.get.GetResult; +import org.opensearch.index.get.GetResultTests; +import org.opensearch.index.seqno.SequenceNumbers; +import org.opensearch.index.shard.ShardId; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.RandomObjects; import java.io.IOException; import java.util.Collections; @@ -46,12 +46,12 @@ import static org.opensearch.action.DocWriteResponse.Result.DELETED; import static org.opensearch.action.DocWriteResponse.Result.NOT_FOUND; import static org.opensearch.action.DocWriteResponse.Result.UPDATED; -import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; -import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; -import static org.elasticsearch.test.XContentTestUtils.insertRandomFields; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertToXContentEquivalent; +import static org.opensearch.cluster.metadata.IndexMetadata.INDEX_UUID_NA_VALUE; +import static org.opensearch.common.xcontent.XContentHelper.toXContent; +import static org.opensearch.test.XContentTestUtils.insertRandomFields; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertToXContentEquivalent; -public class UpdateResponseTests extends ESTestCase { +public class UpdateResponseTests extends OpenSearchTestCase { public void testToXContent() throws IOException { { diff --git a/server/src/test/resources/org/elasticsearch/action/admin/invalid.txt.keystore b/server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/admin/invalid.txt.keystore rename to server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/bulk-log.json b/server/src/test/resources/org/opensearch/action/bulk/bulk-log.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/bulk-log.json rename to server/src/test/resources/org/opensearch/action/bulk/bulk-log.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk-missing-index-type.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk-missing-index-type.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk-missing-index-type.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk-missing-index-type.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk10.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk10.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk10.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk10.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk11.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk11.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk11.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk11.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk2.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk2.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk2.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk2.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk3.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk3.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk3.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk3.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk4.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk4.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk4.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk4.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk5.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk5.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk5.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk5.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk6.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk6.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk6.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk6.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk7.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk7.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk7.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk7.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk8.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk8.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk8.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk8.json diff --git a/server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk9.json b/server/src/test/resources/org/opensearch/action/bulk/simple-bulk9.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/bulk/simple-bulk9.json rename to server/src/test/resources/org/opensearch/action/bulk/simple-bulk9.json diff --git a/server/src/test/resources/org/elasticsearch/action/fieldstats/fieldstats-index-constraints-request.json b/server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/fieldstats/fieldstats-index-constraints-request.json rename to server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json diff --git a/server/src/test/resources/org/elasticsearch/action/search/simple-msearch1.json b/server/src/test/resources/org/opensearch/action/search/simple-msearch1.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/search/simple-msearch1.json rename to server/src/test/resources/org/opensearch/action/search/simple-msearch1.json diff --git a/server/src/test/resources/org/elasticsearch/action/search/simple-msearch2.json b/server/src/test/resources/org/opensearch/action/search/simple-msearch2.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/search/simple-msearch2.json rename to server/src/test/resources/org/opensearch/action/search/simple-msearch2.json diff --git a/server/src/test/resources/org/elasticsearch/action/search/simple-msearch3.json b/server/src/test/resources/org/opensearch/action/search/simple-msearch3.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/search/simple-msearch3.json rename to server/src/test/resources/org/opensearch/action/search/simple-msearch3.json diff --git a/server/src/test/resources/org/elasticsearch/action/search/simple-msearch4.json b/server/src/test/resources/org/opensearch/action/search/simple-msearch4.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/search/simple-msearch4.json rename to server/src/test/resources/org/opensearch/action/search/simple-msearch4.json diff --git a/server/src/test/resources/org/elasticsearch/action/search/simple-msearch5.json b/server/src/test/resources/org/opensearch/action/search/simple-msearch5.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/search/simple-msearch5.json rename to server/src/test/resources/org/opensearch/action/search/simple-msearch5.json diff --git a/server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest1.json b/server/src/test/resources/org/opensearch/action/termvectors/multiRequest1.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest1.json rename to server/src/test/resources/org/opensearch/action/termvectors/multiRequest1.json diff --git a/server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest2.json b/server/src/test/resources/org/opensearch/action/termvectors/multiRequest2.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest2.json rename to server/src/test/resources/org/opensearch/action/termvectors/multiRequest2.json diff --git a/server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest3.json b/server/src/test/resources/org/opensearch/action/termvectors/multiRequest3.json similarity index 100% rename from server/src/test/resources/org/elasticsearch/action/termvectors/multiRequest3.json rename to server/src/test/resources/org/opensearch/action/termvectors/multiRequest3.json