diff --git a/tests/Tests/CommonOptions/AutoExpandReplicas/AutoExpandReplicasTests.cs b/tests/Tests/CommonOptions/AutoExpandReplicas/AutoExpandReplicasTests.cs index 63dedae00b..7e2ea2acea 100644 --- a/tests/Tests/CommonOptions/AutoExpandReplicas/AutoExpandReplicasTests.cs +++ b/tests/Tests/CommonOptions/AutoExpandReplicas/AutoExpandReplicasTests.cs @@ -33,13 +33,15 @@ namespace Tests.CommonOptions.AutoExpandReplicas { + using OpenSearch.Client.Specification.IndicesApi; + public class AutoExpandReplicasTests { [U] public void ImplicitConversionFromNullString() { string nullString = null; - OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas autoExpandReplicas = nullString; + AutoExpandReplicas autoExpandReplicas = nullString; autoExpandReplicas.Should().BeNull(); } @@ -47,7 +49,7 @@ public void ImplicitConversionFromNullString() public void ImplicitConversionFromMinAndMaxString() { var minAndMax = "0-5"; - OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas autoExpandReplicas = minAndMax; + AutoExpandReplicas autoExpandReplicas = minAndMax; autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeTrue(); autoExpandReplicas.MinReplicas.Should().Be(0); @@ -62,7 +64,7 @@ public void ImplicitConversionFromMinAndMaxString() public void ImplicitConversionFromMinAndAllString() { var minAndMax = "0-all"; - OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas autoExpandReplicas = minAndMax; + AutoExpandReplicas autoExpandReplicas = minAndMax; autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeTrue(); autoExpandReplicas.MinReplicas.Should().Be(0); @@ -76,7 +78,7 @@ public void ImplicitConversionFromMinAndAllString() [U] public void CreateWithMinAndMax() { - var autoExpandReplicas = OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create(2, 3); + var autoExpandReplicas = AutoExpandReplicas.Create(2, 3); autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeTrue(); autoExpandReplicas.MinReplicas.Should().Be(2); @@ -90,7 +92,7 @@ public void CreateWithMinAndMax() [U] public void CreateWithMinAndAll() { - var autoExpandReplicas = OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create(0); + var autoExpandReplicas = AutoExpandReplicas.Create(0); autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeTrue(); autoExpandReplicas.MinReplicas.Should().Be(0); @@ -104,7 +106,7 @@ public void CreateWithMinAndAll() [U] public void CreateWithFalse() { - var autoExpandReplicas = OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create("false"); + var autoExpandReplicas = AutoExpandReplicas.Create("false"); autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeFalse(); autoExpandReplicas.MinReplicas.Should().BeNull(); @@ -115,7 +117,7 @@ public void CreateWithFalse() [U] public void Disabled() { - var autoExpandReplicas = OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Disabled; + var autoExpandReplicas = AutoExpandReplicas.Disabled; autoExpandReplicas.Should().NotBeNull(); autoExpandReplicas.Enabled.Should().BeFalse(); autoExpandReplicas.MinReplicas.Should().NotHaveValue(); @@ -126,18 +128,18 @@ public void Disabled() [U] public void MinMustBeEqualOrLessThanMax() => - Assert.Throws(() => OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create(2, 1)); + Assert.Throws(() => AutoExpandReplicas.Create(2, 1)); [U] public void MinMustBeGreaterThanOrEqualToZero() => - Assert.Throws(() => OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create(-1)); + Assert.Throws(() => AutoExpandReplicas.Create(-1)); [U] public void MinMustBeAnInteger() => - Assert.Throws(() => OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create("all-all")); + Assert.Throws(() => AutoExpandReplicas.Create("all-all")); [U] public void MaxMustBeAllOrAnInteger() => - Assert.Throws(() => OpenSearch.Client.Specification.IndicesApi.AutoExpandReplicas.Create("2-boo")); + Assert.Throws(() => AutoExpandReplicas.Create("2-boo")); } } diff --git a/tests/Tests/IndexModules/IndexSettings/Merge/MergeSettings.cs b/tests/Tests/IndexModules/IndexSettings/Merge/MergeSettings.cs index 6ce5e8d5eb..3609376794 100644 --- a/tests/Tests/IndexModules/IndexSettings/Merge/MergeSettings.cs +++ b/tests/Tests/IndexModules/IndexSettings/Merge/MergeSettings.cs @@ -29,16 +29,17 @@ using System; using System.Collections.Generic; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.Merge { + using OpenSearch.Client.Specification.IndicesApi; + public class IndexMergeSettings { /** */ - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -75,8 +76,8 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new() { Merge = new MergeSettings { diff --git a/tests/Tests/IndexModules/IndexSettings/Settings/RoutingPartitionSizeIndexSettings.cs b/tests/Tests/IndexModules/IndexSettings/Settings/RoutingPartitionSizeIndexSettings.cs index 034e119bba..00d66c5fc1 100644 --- a/tests/Tests/IndexModules/IndexSettings/Settings/RoutingPartitionSizeIndexSettings.cs +++ b/tests/Tests/IndexModules/IndexSettings/Settings/RoutingPartitionSizeIndexSettings.cs @@ -30,11 +30,12 @@ using System.Collections.Generic; using OpenSearch.OpenSearch.Xunit.XunitPlumbing; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.Settings { - public class RoutingPartitionSizeIndexSettingsUsage : PromiseUsageTestBase + using OpenSearch.Client.Specification.IndicesApi; + + public class RoutingPartitionSizeIndexSettingsUsage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -49,8 +50,8 @@ public class RoutingPartitionSizeIndexSettingsUsage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new() { RoutingPartitionSize = 6, }; diff --git a/tests/Tests/IndexModules/IndexSettings/Settings/TypedIndexSettings.cs b/tests/Tests/IndexModules/IndexSettings/Settings/TypedIndexSettings.cs index 0f8bea50b2..42e8680647 100644 --- a/tests/Tests/IndexModules/IndexSettings/Settings/TypedIndexSettings.cs +++ b/tests/Tests/IndexModules/IndexSettings/Settings/TypedIndexSettings.cs @@ -29,16 +29,17 @@ using System; using System.Collections.Generic; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.Settings { + using OpenSearch.Client.Specification.IndicesApi; + public class TypedIndexSettings { /** */ - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -95,8 +96,8 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings(new Dictionary + protected override IndexSettings Initializer => + new(new Dictionary { { "any.setting", "can be set" }, { "doubles", 1.1 }, diff --git a/tests/Tests/IndexModules/IndexSettings/SlowLog/SlowLogSettings.cs b/tests/Tests/IndexModules/IndexSettings/SlowLog/SlowLogSettings.cs index d08b66c468..07a2bc24d0 100644 --- a/tests/Tests/IndexModules/IndexSettings/SlowLog/SlowLogSettings.cs +++ b/tests/Tests/IndexModules/IndexSettings/SlowLog/SlowLogSettings.cs @@ -29,16 +29,17 @@ using System; using System.Collections.Generic; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.SlowLog { + using OpenSearch.Client.Specification.IndicesApi; + public class SlowLogSettings { /** */ - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -91,10 +92,10 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new() { - SlowLog = new OpenSearch.Client.Specification.IndicesApi.SlowLog + SlowLog = new SlowLog { Indexing = new SlowLogIndexing { diff --git a/tests/Tests/IndexModules/IndexSettings/Sorting/SortingSettingsSingleItem.cs b/tests/Tests/IndexModules/IndexSettings/Sorting/SortingSettingsSingleItem.cs index 0acb5b834d..a2a0bb99d3 100644 --- a/tests/Tests/IndexModules/IndexSettings/Sorting/SortingSettingsSingleItem.cs +++ b/tests/Tests/IndexModules/IndexSettings/Sorting/SortingSettingsSingleItem.cs @@ -29,10 +29,11 @@ using System; using System.Collections.Generic; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.Sorting { + using OpenSearch.Client.Specification.IndicesApi; + public class SortingSettingsSingleItem { private class TestClass @@ -42,7 +43,7 @@ private class TestClass public string field1 { get; set; } } - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -60,8 +61,8 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new IndexSettings { Sorting = new SortingSettings { @@ -86,7 +87,7 @@ private class TestClass public string field2 { get; set; } } - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -104,8 +105,8 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new() { Sorting = new SortingSettings { diff --git a/tests/Tests/IndexModules/IndexSettings/Translog/TranslogSettings.cs b/tests/Tests/IndexModules/IndexSettings/Translog/TranslogSettings.cs index 43ab926125..8f750cae3a 100644 --- a/tests/Tests/IndexModules/IndexSettings/Translog/TranslogSettings.cs +++ b/tests/Tests/IndexModules/IndexSettings/Translog/TranslogSettings.cs @@ -29,16 +29,17 @@ using System; using System.Collections.Generic; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; namespace Tests.IndexModules.IndexSettings.Translog { + using OpenSearch.Client.Specification.IndicesApi; + public class TranlogSettings { /** */ - public class Usage : PromiseUsageTestBase + public class Usage : PromiseUsageTestBase { protected override object ExpectJson => new Dictionary { @@ -64,8 +65,8 @@ public class Usage : PromiseUsageTestBase - new OpenSearch.Client.Specification.IndicesApi.IndexSettings + protected override IndexSettings Initializer => + new() { Translog = new TranslogSettings { diff --git a/tests/Tests/Indices/IndexManagement/CloneIndex/CloneIndexApiTests.cs b/tests/Tests/Indices/IndexManagement/CloneIndex/CloneIndexApiTests.cs index bf907c9101..9579c87b6d 100644 --- a/tests/Tests/Indices/IndexManagement/CloneIndex/CloneIndexApiTests.cs +++ b/tests/Tests/Indices/IndexManagement/CloneIndex/CloneIndexApiTests.cs @@ -32,7 +32,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -40,6 +39,8 @@ namespace Tests.Indices.IndexManagement.CloneIndex { + using OpenSearch.Client.Specification.IndicesApi; + public class CloneIndexApiTests : ApiIntegrationTestBase { @@ -108,9 +109,9 @@ protected override void IntegrationSetup(IOpenSearchClient client, CallUniqueVal protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override CloneIndexRequest Initializer => new CloneIndexRequest(CallIsolatedValue, CallIsolatedValue + CloneSuffix) + protected override CloneIndexRequest Initializer => new(CallIsolatedValue, CallIsolatedValue + CloneSuffix) { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfReplicas = 0, NumberOfShards = 1, @@ -137,7 +138,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.CloneAsync(r) ); - protected override CloneIndexDescriptor NewDescriptor() => new CloneIndexDescriptor(CallIsolatedValue, CallIsolatedValue + CloneSuffix); + protected override CloneIndexDescriptor NewDescriptor() => new(CallIsolatedValue, CallIsolatedValue + CloneSuffix); protected override void ExpectResponse(CloneIndexResponse response) { diff --git a/tests/Tests/Indices/IndexManagement/CreateIndex/CreateIndexApiTests.cs b/tests/Tests/Indices/IndexManagement/CreateIndex/CreateIndexApiTests.cs index d646d6e81b..c33b2902da 100644 --- a/tests/Tests/Indices/IndexManagement/CreateIndex/CreateIndexApiTests.cs +++ b/tests/Tests/Indices/IndexManagement/CreateIndex/CreateIndexApiTests.cs @@ -32,7 +32,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -40,6 +39,8 @@ namespace Tests.Indices.IndexManagement.CreateIndex { + using OpenSearch.Client.Specification.IndicesApi; + public class CreateIndexApiTests : ApiIntegrationTestBase { @@ -156,9 +157,9 @@ public CreateIndexApiTests(WritableCluster cluster, EndpointUsage usage) : base( protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override CreateIndexRequest Initializer => new CreateIndexRequest(CallIsolatedValue) + protected override CreateIndexRequest Initializer => new(CallIsolatedValue) { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfReplicas = 1, NumberOfShards = 1, @@ -235,7 +236,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.CreateAsync(r) ); - protected override CreateIndexDescriptor NewDescriptor() => new CreateIndexDescriptor(CallIsolatedValue); + protected override CreateIndexDescriptor NewDescriptor() => new(CallIsolatedValue); protected override void ExpectResponse(CreateIndexResponse response) { @@ -307,9 +308,9 @@ public CreateIndexWithAliasApiTests(WritableCluster cluster, EndpointUsage usage protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override CreateIndexRequest Initializer => new CreateIndexRequest(CallIsolatedValue) + protected override CreateIndexRequest Initializer => new(CallIsolatedValue) { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfReplicas = 0, NumberOfShards = 1, @@ -329,7 +330,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.CreateAsync(r) ); - protected override CreateIndexDescriptor NewDescriptor() => new CreateIndexDescriptor(CallIsolatedValue); + protected override CreateIndexDescriptor NewDescriptor() => new(CallIsolatedValue); protected override void ExpectResponse(CreateIndexResponse response) { @@ -387,9 +388,9 @@ public CreateHiddenIndexApiTests(WritableCluster cluster, EndpointUsage usage) : protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override CreateIndexRequest Initializer => new CreateIndexRequest(CallIsolatedValue) + protected override CreateIndexRequest Initializer => new(CallIsolatedValue) { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfReplicas = 0, NumberOfShards = 1, @@ -410,7 +411,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.CreateAsync(r) ); - protected override CreateIndexDescriptor NewDescriptor() => new CreateIndexDescriptor(CallIsolatedValue); + protected override CreateIndexDescriptor NewDescriptor() => new(CallIsolatedValue); protected override void ExpectResponse(CreateIndexResponse response) { diff --git a/tests/Tests/Indices/IndexManagement/RolloverIndex/RolloverIndexApiTests.cs b/tests/Tests/Indices/IndexManagement/RolloverIndex/RolloverIndexApiTests.cs index bd71ea013a..f2ce20c83b 100644 --- a/tests/Tests/Indices/IndexManagement/RolloverIndex/RolloverIndexApiTests.cs +++ b/tests/Tests/Indices/IndexManagement/RolloverIndex/RolloverIndexApiTests.cs @@ -32,7 +32,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Domain; @@ -41,6 +40,8 @@ namespace Tests.Indices.IndexManagement.RolloverIndex { + using OpenSearch.Client.Specification.IndicesApi; + public class RolloverIndexApiTests : ApiIntegrationTestBase { @@ -116,14 +117,14 @@ public RolloverIndexApiTests(WritableCluster cluster, EndpointUsage usage) .Alias(CallIsolatedValue + "-new_projects") ); - protected override RolloverIndexRequest Initializer => new RolloverIndexRequest(CallIsolatedValue + "-alias", CallIsolatedValue + "-new") + protected override RolloverIndexRequest Initializer => new(CallIsolatedValue + "-alias", CallIsolatedValue + "-new") { Conditions = new RolloverConditions { MaxAge = "7d", MaxDocs = 1000 }, - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 1, NumberOfReplicas = 1 @@ -178,7 +179,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.RolloverAsync(r) ); - protected override RolloverIndexDescriptor NewDescriptor() => new RolloverIndexDescriptor(CallIsolatedValue + "-alias"); + protected override RolloverIndexDescriptor NewDescriptor() => new(CallIsolatedValue + "-alias"); protected override void ExpectResponse(RolloverIndexResponse response) { diff --git a/tests/Tests/Indices/IndexManagement/ShrinkIndex/ShrinkIndexApiTests.cs b/tests/Tests/Indices/IndexManagement/ShrinkIndex/ShrinkIndexApiTests.cs index 0134fe74de..7250fd0f7b 100644 --- a/tests/Tests/Indices/IndexManagement/ShrinkIndex/ShrinkIndexApiTests.cs +++ b/tests/Tests/Indices/IndexManagement/ShrinkIndex/ShrinkIndexApiTests.cs @@ -31,7 +31,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -39,6 +38,8 @@ namespace Tests.Indices.IndexManagement.ShrinkIndex { + using OpenSearch.Client.Specification.IndicesApi; + public class ShrinkIndexApiTests : ApiIntegrationTestBase { @@ -63,9 +64,9 @@ public ShrinkIndexApiTests(WritableCluster cluster, EndpointUsage usage) : base( protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override ShrinkIndexRequest Initializer => new ShrinkIndexRequest(CallIsolatedValue, CallIsolatedValue + "-target") + protected override ShrinkIndexRequest Initializer => new(CallIsolatedValue, CallIsolatedValue + "-target") { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 4 } @@ -97,7 +98,7 @@ protected override void OnBeforeCall(IOpenSearchClient client) update.ShouldBeValid(); } - protected override ShrinkIndexDescriptor NewDescriptor() => new ShrinkIndexDescriptor(CallIsolatedValue, CallIsolatedValue + "-target"); + protected override ShrinkIndexDescriptor NewDescriptor() => new(CallIsolatedValue, CallIsolatedValue + "-target"); protected override void ExpectResponse(ShrinkIndexResponse response) { diff --git a/tests/Tests/Indices/IndexManagement/SplitIndex/SplitIndexApiTests.cs b/tests/Tests/Indices/IndexManagement/SplitIndex/SplitIndexApiTests.cs index c64a9c7aa7..996175af28 100644 --- a/tests/Tests/Indices/IndexManagement/SplitIndex/SplitIndexApiTests.cs +++ b/tests/Tests/Indices/IndexManagement/SplitIndex/SplitIndexApiTests.cs @@ -31,7 +31,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -39,6 +38,8 @@ namespace Tests.Indices.IndexManagement.SplitIndex { + using OpenSearch.Client.Specification.IndicesApi; + public class SplitIndexApiTests : ApiIntegrationTestBase { @@ -63,9 +64,9 @@ public SplitIndexApiTests(WritableCluster cluster, EndpointUsage usage) : base(c protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override SplitIndexRequest Initializer => new SplitIndexRequest(CallIsolatedValue, CallIsolatedValue + "-target") + protected override SplitIndexRequest Initializer => new(CallIsolatedValue, CallIsolatedValue + "-target") { - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 8 } @@ -98,7 +99,7 @@ protected override void OnBeforeCall(IOpenSearchClient client) update.ShouldBeValid(); } - protected override SplitIndexDescriptor NewDescriptor() => new SplitIndexDescriptor(CallIsolatedValue, CallIsolatedValue + "-target"); + protected override SplitIndexDescriptor NewDescriptor() => new(CallIsolatedValue, CallIsolatedValue + "-target"); protected override void ExpectResponse(SplitIndexResponse response) { diff --git a/tests/Tests/Indices/IndexSettings/IndexTemplates/IndexTemplateCrudTests.cs b/tests/Tests/Indices/IndexSettings/IndexTemplates/IndexTemplateCrudTests.cs index 9af3a48d3e..afebc15be7 100644 --- a/tests/Tests/Indices/IndexSettings/IndexTemplates/IndexTemplateCrudTests.cs +++ b/tests/Tests/Indices/IndexSettings/IndexTemplates/IndexTemplateCrudTests.cs @@ -30,7 +30,6 @@ using System.Threading.Tasks; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -38,6 +37,8 @@ namespace Tests.Indices.IndexSettings.IndexTemplates { + using OpenSearch.Client.Specification.IndicesApi; + public class IndexTemplateCrudTests : CrudTestBase @@ -64,10 +65,10 @@ protected override LazyResponses Create() => (s, c, r) => c.Indices.PutTemplateAsync(r) ); - private PutIndexTemplateRequest CreateInitializer(string name) => new PutIndexTemplateRequest(name) + private PutIndexTemplateRequest CreateInitializer(string name) => new(name) { IndexPatterns = new[] { "startingwiththis-*" }, - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 2 } @@ -108,10 +109,10 @@ protected override LazyResponses Update() => (s, c, r) => c.Indices.PutTemplateAsync(r) ); - private PutIndexTemplateRequest PutInitializer(string name) => new PutIndexTemplateRequest(name) + private PutIndexTemplateRequest PutInitializer(string name) => new(name) { IndexPatterns = new[] { "startingwiththis-*" }, - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 1 } diff --git a/tests/Tests/Indices/IndexSettings/IndexTemplates/PutIndexTemplate/PutIndexTemplateApiTests.cs b/tests/Tests/Indices/IndexSettings/IndexTemplates/PutIndexTemplate/PutIndexTemplateApiTests.cs index c16c5926a3..c6d22b6546 100644 --- a/tests/Tests/Indices/IndexSettings/IndexTemplates/PutIndexTemplate/PutIndexTemplateApiTests.cs +++ b/tests/Tests/Indices/IndexSettings/IndexTemplates/PutIndexTemplate/PutIndexTemplateApiTests.cs @@ -31,7 +31,6 @@ using OpenSearch.Net; using FluentAssertions; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.Extensions; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; @@ -39,6 +38,8 @@ namespace Tests.Indices.IndexSettings.IndexTemplates.PutIndexTemplate { + using OpenSearch.Client.Specification.IndicesApi; + public class PutIndexTemplateApiTests : ApiIntegrationTestBase @@ -98,13 +99,13 @@ public PutIndexTemplateApiTests(WritableCluster cluster, EndpointUsage usage) : protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override PutIndexTemplateRequest Initializer => new PutIndexTemplateRequest(CallIsolatedValue) + protected override PutIndexTemplateRequest Initializer => new(CallIsolatedValue) { Order = 1, Version = 2, IndexPatterns = new[] { "oscx-*" }, Create = false, - Settings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + Settings = new IndexSettings { NumberOfShards = 1 }, @@ -132,7 +133,7 @@ protected override LazyResponses ClientUsage() => Calls( (client, r) => client.Indices.PutTemplateAsync(r) ); - protected override PutIndexTemplateDescriptor NewDescriptor() => new PutIndexTemplateDescriptor(CallIsolatedValue); + protected override PutIndexTemplateDescriptor NewDescriptor() => new(CallIsolatedValue); protected override void ExpectResponse(PutIndexTemplateResponse response) { diff --git a/tests/Tests/Indices/IndexSettings/UpdateIndicesSettings/UpdateIndexSettingsApiTests.cs b/tests/Tests/Indices/IndexSettings/UpdateIndicesSettings/UpdateIndexSettingsApiTests.cs index f9841ceee3..98afdd6cb7 100644 --- a/tests/Tests/Indices/IndexSettings/UpdateIndicesSettings/UpdateIndexSettingsApiTests.cs +++ b/tests/Tests/Indices/IndexSettings/UpdateIndicesSettings/UpdateIndexSettingsApiTests.cs @@ -30,13 +30,14 @@ using System.Collections.Generic; using OpenSearch.Net; using OpenSearch.Client; -using OpenSearch.Client.Specification.IndicesApi; using Tests.Core.ManagedOpenSearch.Clusters; using Tests.Framework.EndpointTests; using Tests.Framework.EndpointTests.TestState; namespace Tests.Indices.IndexSettings.UpdateIndicesSettings { + using OpenSearch.Client.Specification.IndicesApi; + public class UpdateIndexSettingsApiTests : ApiIntegrationTestBase @@ -64,9 +65,9 @@ public UpdateIndexSettingsApiTests(WritableCluster cluster, EndpointUsage usage) protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override UpdateIndexSettingsRequest Initializer => new UpdateIndexSettingsRequest(CallIsolatedValue) + protected override UpdateIndexSettingsRequest Initializer => new(CallIsolatedValue) { - IndexSettings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings(new Dictionary + IndexSettings = new IndexSettings(new Dictionary { { "index.number_of_replicas", 3 }, { "index.priority", 2 } @@ -122,9 +123,9 @@ public UpdateIndexSettingsRefreshIntervalNullApiTests(WritableCluster cluster, E protected override HttpMethod HttpMethod => HttpMethod.PUT; - protected override UpdateIndexSettingsRequest Initializer => new UpdateIndexSettingsRequest(CallIsolatedValue) + protected override UpdateIndexSettingsRequest Initializer => new(CallIsolatedValue) { - IndexSettings = new OpenSearch.Client.Specification.IndicesApi.IndexSettings + IndexSettings = new IndexSettings { RefreshInterval = null }