diff --git a/benchmarks/Benchmarks/packages.lock.json b/benchmarks/Benchmarks/packages.lock.json index 08614b0e273..0c67ba90ca1 100644 --- a/benchmarks/Benchmarks/packages.lock.json +++ b/benchmarks/Benchmarks/packages.lock.json @@ -67,8 +67,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1195,7 +1195,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } } diff --git a/benchmarks/Profiling/packages.lock.json b/benchmarks/Profiling/packages.lock.json index f1ff9c7aec7..4fbb49c50f4 100644 --- a/benchmarks/Profiling/packages.lock.json +++ b/benchmarks/Profiling/packages.lock.json @@ -31,8 +31,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -131,7 +131,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } } diff --git a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json index abd3d524cd2..880da78d98b 100644 --- a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json +++ b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json @@ -37,8 +37,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -143,7 +143,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } }, @@ -183,8 +183,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -332,7 +332,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } }, @@ -381,8 +381,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -529,7 +529,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } }, @@ -569,8 +569,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -709,7 +709,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } }, @@ -749,8 +749,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -849,7 +849,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } }, @@ -889,8 +889,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -989,7 +989,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } } } diff --git a/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs b/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs index f38c477ee5c..10780cbce97 100644 --- a/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs +++ b/src/Elastic.Clients.Elasticsearch/Api/BulkResponse.cs @@ -20,7 +20,7 @@ public partial class BulkResponse ? Enumerable.Empty() : Items.Where(i => !i.IsValid); - public override bool IsValid => base.IsValid && !Errors && !ItemsWithErrors.HasAny(); + public override bool IsValidResponse => base.IsValidResponse && !Errors && !ItemsWithErrors.HasAny(); protected override void DebugIsValid(StringBuilder sb) { diff --git a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs b/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs index 086d28e4fbb..a5335125c42 100644 --- a/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs +++ b/src/Elastic.Clients.Elasticsearch/Client/ElasticsearchResponseBaseExtensions.cs @@ -8,5 +8,5 @@ namespace Elastic.Clients.Elasticsearch; public static class ElasticsearchResponseExtensions { - public static bool IsSuccess(this ElasticsearchResponse response) => response.ApiCallDetails is not null && response.ApiCallDetails.Success; + public static bool IsSuccess(this ElasticsearchResponse response) => response.ApiCallDetails is not null && response.ApiCallDetails.HasSuccessfulStatusCode; } diff --git a/src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs b/src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs index 419a1a1943d..3f00d9bb255 100644 --- a/src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs +++ b/src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs @@ -16,7 +16,7 @@ public ElasticsearchClientProductRegistration(Type markerType) : base(markerType public static ElasticsearchClientProductRegistration DefaultForElasticsearchClientsElasticsearch { get; } = new(typeof(ElasticsearchClient)); /// - /// Elastic.Clients.Elasticsearch handles 404 in its , we do not want the low level client throwing + /// Elastic.Clients.Elasticsearch handles 404 in its , we do not want the low level client throwing /// exceptions /// when is enabled for 404's. The client is in charge of /// composing paths @@ -33,7 +33,7 @@ public override bool TryGetServerErrorReason(TResponse response, [Not { if (response is not ElasticsearchResponse r) return base.TryGetServerErrorReason(response, out reason); - reason = r.ServerError?.Error?.ToString(); + reason = r.ElasticsearchServerError?.Error?.ToString(); return !string.IsNullOrEmpty(reason); } } diff --git a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj index 7d00cdd7682..e2c7bb63457 100644 --- a/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj +++ b/src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj @@ -17,7 +17,7 @@ annotations - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs b/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs index ee97e517a3e..ead1f141e40 100644 --- a/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs +++ b/src/Elastic.Clients.Elasticsearch/Helpers/BulkAllObservable.cs @@ -109,7 +109,7 @@ private void RefreshOnCompleted() var refresh = _client.Indices.Refresh(request); - if (!refresh.IsValid) + if (!refresh.IsValidResponse) throw Throw($"Refreshing after all documents have indexed failed", refresh); } @@ -155,7 +155,7 @@ private async Task BulkAsync(IList buffer, long page, int ba _compositeCancelToken.ThrowIfCancellationRequested(); _bulkResponseCallback?.Invoke(response); - if (!response.ApiCallDetails.Success) + if (!response.ApiCallDetails.HasSuccessfulStatusCode) return await HandleBulkRequestAsync(buffer, page, backOffRetries, response).ConfigureAwait(false); var retryableDocuments = new List(); diff --git a/src/Elastic.Clients.Elasticsearch/Types/Documents/MultiSearch/MultiSearchRequest.cs b/src/Elastic.Clients.Elasticsearch/Types/Documents/MultiSearch/MultiSearchRequest.cs index fe259c73dfa..c7fc45a28af 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Documents/MultiSearch/MultiSearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Documents/MultiSearch/MultiSearchRequest.cs @@ -9,7 +9,7 @@ namespace Elastic.Clients.Elasticsearch; public partial class MultiSearchResponse { - public override bool IsValid => base.IsValid && (Responses?.All(b => b.Item1 is not null && b.Item1.Status == 200) ?? true); + public override bool IsValidResponse => base.IsValidResponse && (Responses?.All(b => b.Item1 is not null && b.Item1.Status == 200) ?? true); [JsonIgnore] public int TotalResponses => Responses.HasAny() ? Responses.Count() : 0; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs index a081e54bc9c..9f843fb3fc3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class ExistsResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs index 8a9137e3d9e..ecb3adc2150 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExistsSourceResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class ExistsSourceResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs index 9e2e9f06f21..a6020683fd7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsAliasResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class ExistsAliasResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs index 7adb14b71a3..bae7521a765 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsIndexTemplateResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class ExistsIndexTemplateResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs index feb94704c52..a5a6be3eca9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class ExistsResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs index 4f0d0cd1141..881d6d12abe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ExistsTemplateResponse.g.cs @@ -25,5 +25,5 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class ExistsTemplateResponse : ElasticsearchResponse { - public bool Exists => ApiCallDetails is { Success: true, HttpStatusCode: 200 }; + public bool Exists => ApiCallDetails is { HasSuccessfulStatusCode: true, HttpStatusCode: 200 }; } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/packages.lock.json b/src/Elastic.Clients.Elasticsearch/packages.lock.json index fa098c0cfc2..4712eae0189 100644 --- a/src/Elastic.Clients.Elasticsearch/packages.lock.json +++ b/src/Elastic.Clients.Elasticsearch/packages.lock.json @@ -22,9 +22,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -163,9 +163,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -347,9 +347,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -539,9 +539,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -714,9 +714,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -849,9 +849,9 @@ }, "Elastic.Transport": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", diff --git a/src/Playground/Program.cs b/src/Playground/Program.cs index 459601d81fc..fb8242e58e1 100644 --- a/src/Playground/Program.cs +++ b/src/Playground/Program.cs @@ -8,17 +8,21 @@ using Elastic.Transport; using Moq; using Playground; -using CreateResponse = Elastic.Clients.Elasticsearch.IndexManagement.CreateResponse; +using CreateIndexResponse = Elastic.Clients.Elasticsearch.IndexManagement.CreateResponse; // const string IndexName = "stock-demo-v1"; -var mockedResponse = ResponseFactory.CreateResponse(new CreateResponse { Acknowledged = true, Index = "testing", ShardsAcknowledged = true }, 200); +var createResponse = new CreateIndexResponse { Acknowledged = true, Index = "testing", ShardsAcknowledged = true }; +var mockedResponse = TestableResponseFactory.CreateSuccessfulResponse(createResponse, 201); var mockedClient = Mock.Of(e => e.Indices.Create() == mockedResponse); var testResponse = mockedClient.Indices.Create(); +if (testResponse.IsValidResponse) + Console.WriteLine("SUCCESS"); + // ALTERNATIVE var stubbedClient = new TestableElasticsearchClient(); @@ -291,6 +295,6 @@ public class TestableElasticsearchClient : ElasticsearchClient public class TestIndicesNamespace : IndicesNamespacedClient { - public override CreateResponse Create() => - ResponseFactory.CreateResponse(new CreateResponse { Acknowledged = true, Index = "testing", ShardsAcknowledged = true }, 200); + public override CreateIndexResponse Create() => + TestableResponseFactory.CreateSuccessfulResponse(new CreateIndexResponse { Acknowledged = true, Index = "testing", ShardsAcknowledged = true }, 201); } diff --git a/src/Playground/packages.lock.json b/src/Playground/packages.lock.json index ef2f67930ff..c56f0612e5e 100644 --- a/src/Playground/packages.lock.json +++ b/src/Playground/packages.lock.json @@ -48,8 +48,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -153,7 +153,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { diff --git a/tests/Tests.ClusterLauncher/packages.lock.json b/tests/Tests.ClusterLauncher/packages.lock.json index 342f570ef1b..a35874d5be4 100644 --- a/tests/Tests.ClusterLauncher/packages.lock.json +++ b/tests/Tests.ClusterLauncher/packages.lock.json @@ -75,8 +75,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1271,7 +1271,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { @@ -1388,8 +1388,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -2588,7 +2588,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { @@ -2705,8 +2705,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -3905,7 +3905,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { diff --git a/tests/Tests.Core/Extensions/ShouldExtensions.cs b/tests/Tests.Core/Extensions/ShouldExtensions.cs index cb04c1ee1e3..98d58d693a2 100644 --- a/tests/Tests.Core/Extensions/ShouldExtensions.cs +++ b/tests/Tests.Core/Extensions/ShouldExtensions.cs @@ -13,20 +13,19 @@ namespace Tests.Core.Extensions public static class ShouldExtensions { public static void ShouldHaveExpectedIsValid(this ElasticsearchResponse response, bool expectedIsValid) => - response.IsValid.Should().Be(expectedIsValid, "{0}", response.DebugInformation); + response.IsValidResponse.Should().Be(expectedIsValid, "{0}", response.DebugInformation); public static void ShouldBeValid(this ElasticsearchResponse response) => - response.IsValid.Should().BeTrue("{0}", response.DebugInformation); + response.IsValidResponse.Should().BeTrue("{0}", response.DebugInformation); public static void ShouldBeValid(this ElasticsearchResponse response, string message) => - response.IsValid.Should().BeTrue("{1} {0}", response.DebugInformation, message); + response.IsValidResponse.Should().BeTrue("{1} {0}", response.DebugInformation, message); public static void ShouldNotBeValid(this ElasticsearchResponse response) => - response.IsValid.Should().BeFalse("{0}", response.DebugInformation); + response.IsValidResponse.Should().BeFalse("{0}", response.DebugInformation); public static void ShouldBeSuccess(this ElasticsearchResponse response) => - response.ApiCallDetails.Success.Should().BeTrue("{0}", response.DebugInformation); - + response.ApiCallDetails.HasSuccessfulStatusCode.Should().BeTrue("{0}", response.DebugInformation); //public static void ShouldAdhereToSourceSerializerWhenSet(this Project project) //{ diff --git a/tests/Tests.Core/packages.lock.json b/tests/Tests.Core/packages.lock.json index 31c179b7458..ad79494e0aa 100644 --- a/tests/Tests.Core/packages.lock.json +++ b/tests/Tests.Core/packages.lock.json @@ -137,8 +137,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1589,7 +1589,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": { diff --git a/tests/Tests.Domain/packages.lock.json b/tests/Tests.Domain/packages.lock.json index 8a22962dfad..854d7f49fec 100644 --- a/tests/Tests.Domain/packages.lock.json +++ b/tests/Tests.Domain/packages.lock.json @@ -57,8 +57,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1142,7 +1142,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "tests.configuration": { diff --git a/tests/Tests/ClientConcepts/Errors/ServerErrorTestsBase.cs b/tests/Tests/ClientConcepts/Errors/ServerErrorTestsBase.cs index 4c6a874d7ea..1297c9737d4 100644 --- a/tests/Tests/ClientConcepts/Errors/ServerErrorTestsBase.cs +++ b/tests/Tests/ClientConcepts/Errors/ServerErrorTestsBase.cs @@ -32,7 +32,7 @@ protected void HighLevelCall() { var response = HighLevelClient.Search(s => { }); response.Should().NotBeNull(); - var serverError = response.ServerError; + var serverError = response.ElasticsearchServerError; serverError.Should().NotBeNull(); serverError.Status.Should().Be(response.ApiCallDetails.HttpStatusCode); serverError.Error.Should().NotBeNull(); diff --git a/tests/Tests/Document/Multiple/Bulk/BulkInvalidVersionApiTests.cs b/tests/Tests/Document/Multiple/Bulk/BulkInvalidVersionApiTests.cs index 724f138db2e..821f67d1d19 100644 --- a/tests/Tests/Document/Multiple/Bulk/BulkInvalidVersionApiTests.cs +++ b/tests/Tests/Document/Multiple/Bulk/BulkInvalidVersionApiTests.cs @@ -59,9 +59,9 @@ protected override LazyResponses ClientUsage() => Calls( protected override void ExpectResponse(BulkResponse response) { response.ShouldNotBeValid(); - response.ServerError.Should().NotBeNull(); - response.ServerError.Status.Should().Be(400); - response.ServerError.Error.Type.Should().Be("illegal_argument_exception"); - response.ServerError.Error.Reason.Should().StartWith("sequence numbers must be non negative."); + response.ElasticsearchServerError.Should().NotBeNull(); + response.ElasticsearchServerError.Status.Should().Be(400); + response.ElasticsearchServerError.Error.Type.Should().Be("illegal_argument_exception"); + response.ElasticsearchServerError.Error.Reason.Should().StartWith("sequence numbers must be non negative."); } } diff --git a/tests/Tests/Document/Single/Delete/DeleteApiTests.cs b/tests/Tests/Document/Single/Delete/DeleteApiTests.cs index aaff33c59f2..14b797c0806 100644 --- a/tests/Tests/Document/Single/Delete/DeleteApiTests.cs +++ b/tests/Tests/Document/Single/Delete/DeleteApiTests.cs @@ -166,7 +166,7 @@ protected override void ExpectResponse(DeleteResponse response) { response.ShouldNotBeValid(); //response.Result.Should().Be(Result.Error); TODO: This doesn't work until a valid default is set - response.ServerError.Should().NotBeNull(); - response.ServerError.Error.Reason.Should().StartWith("no such index"); + response.ElasticsearchServerError.Should().NotBeNull(); + response.ElasticsearchServerError.Error.Reason.Should().StartWith("no such index"); } } diff --git a/tests/Tests/Document/Single/DocumentsCoordinatedTests.cs b/tests/Tests/Document/Single/DocumentsCoordinatedTests.cs index cbbecf606b3..7910d049ac7 100644 --- a/tests/Tests/Document/Single/DocumentsCoordinatedTests.cs +++ b/tests/Tests/Document/Single/DocumentsCoordinatedTests.cs @@ -73,7 +73,7 @@ public DocumentsCoordinatedTests(WritableCluster cluster, EndpointUsage usage) : [I] public async Task CreateResponse() => await Assert(IndexDocumentStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Index.Should().Be("project"); r.Id.Should().Be(v); r.Version.Should().BeGreaterOrEqualTo(1); @@ -88,13 +88,13 @@ public async Task CreateResponse() => await Assert(IndexDocumentS [I] public async Task ExistsResponse() => await Assert(DocumentExistsStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); }); [I] public async Task GetResponse() => await Assert>(GetDocumentStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Index.Should().Be("project"); r.Id.Should().Be(v); r.Version.Should().BeGreaterOrEqualTo(1); @@ -114,7 +114,7 @@ public async Task GetResponse() => await Assert>(GetDocumen [I] public async Task DeleteResponse() => await Assert(DeleteDocumentStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Index.Should().Be("project"); r.Id.Should().Be(v); r.Version.Should().BeGreaterOrEqualTo(1); diff --git a/tests/Tests/Document/Single/Get/GetApiTests.cs b/tests/Tests/Document/Single/Get/GetApiTests.cs index 66409722c87..861b18ddb08 100644 --- a/tests/Tests/Document/Single/Get/GetApiTests.cs +++ b/tests/Tests/Document/Single/Get/GetApiTests.cs @@ -134,7 +134,7 @@ protected override void ExpectResponse(GetResponse response) { response.Found.Should().BeFalse(); response.Index.Should().BeNull(); - response.ServerError.Should().NotBeNull(); + response.ElasticsearchServerError.Should().NotBeNull(); } } diff --git a/tests/Tests/Document/Single/Index/IndexApiTests.cs b/tests/Tests/Document/Single/Index/IndexApiTests.cs index cb783394d2e..59d9800e0bf 100644 --- a/tests/Tests/Document/Single/Index/IndexApiTests.cs +++ b/tests/Tests/Document/Single/Index/IndexApiTests.cs @@ -108,9 +108,9 @@ public void OpTypeCreate() indexResult.ShouldNotBeValid(); indexResult.ApiCallDetails.HttpStatusCode.Should().Be(409); - indexResult.ServerError.Should().NotBeNull(); - indexResult.ServerError.Error.Type.Should().Contain("conflict"); - indexResult.ServerError.Status.Should().Be(409); + indexResult.ElasticsearchServerError.Should().NotBeNull(); + indexResult.ElasticsearchServerError.Error.Type.Should().Contain("conflict"); + indexResult.ElasticsearchServerError.Status.Should().Be(409); } [I] diff --git a/tests/Tests/Document/Single/Update/UpdateDocumentsCoordinatedTests.cs b/tests/Tests/Document/Single/Update/UpdateDocumentsCoordinatedTests.cs index f2ebe4a4926..3d7356452d2 100644 --- a/tests/Tests/Document/Single/Update/UpdateDocumentsCoordinatedTests.cs +++ b/tests/Tests/Document/Single/Update/UpdateDocumentsCoordinatedTests.cs @@ -150,14 +150,14 @@ public UpdateDocumentsCoordinatedTests(WritableCluster cluster, EndpointUsage us [I] public async Task UpdateWithScriptResponse() => await Assert>(UpdateWithScriptStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Result.Should().Be(Result.Updated); }); [I] public async Task GetResponseAfterScriptedUpdateStep() => await Assert>(GetAfterScriptedUpdateStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Source.Name.Should().Be("Initial"); // The name should not have changed r.Source.Counter.Should().Be(5); // The script updates by 4 r.Source.RenamedField.Should().BeNull(); // This hasn't been set yet and should not exist on the source @@ -166,14 +166,14 @@ public async Task GetResponseAfterScriptedUpdateStep() => await Assert await Assert>(UpdateWithPartialStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Result.Should().Be(Result.Updated); }); [I] public async Task GetResponseAfterPartialUpdateStep() => await Assert>(GetAfterPartialUpdateStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Source.Name.Should().Be("Initial"); // The name should not have changed r.Source.Counter.Should().Be(5); // The count should still be five r.Source.RenamedField.Should().Be("Partial"); // The partial update should have added the partial value for RenamedField @@ -182,21 +182,21 @@ public async Task GetResponseAfterPartialUpdateStep() => await Assert await Assert>(UpdateWithPartialStepTwo, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Result.Should().Be(Result.NoOp); }); [I] public async Task UpsertExistingResponse() => await Assert>(UpsertExistingStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Result.Should().Be(Result.Updated); }); [I] public async Task GetResponseAfterUpsertExistingStep() => await Assert>(GetAfterUpsertExistingStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Source.Name.Should().Be("Initial"); // The name should not have changed r.Source.Counter.Should().Be(9); // The count should have been updated by the script r.Source.RenamedField.Should().Be("Partial"); // The RenamedField should not have changed @@ -205,14 +205,14 @@ public async Task GetResponseAfterUpsertExistingStep() => await Assert await Assert>(UpsertNewStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Result.Should().Be(Result.Created); }); [I] public async Task GetResponseAfterUpsertNewStep() => await Assert>(GetAfterUpsertNewStep, (v, r) => { - r.IsValid.Should().BeTrue(); + r.IsValidResponse.Should().BeTrue(); r.Source.Name.Should().Be("Newly inserted"); r.Source.Counter.Should().Be(100); r.Source.RenamedField.Should().BeNull(); diff --git a/tests/Tests/Framework/EndpointTests/ApiIntegrationTestBase.cs b/tests/Tests/Framework/EndpointTests/ApiIntegrationTestBase.cs index f3a2e3583a2..e25b02724c6 100644 --- a/tests/Tests/Framework/EndpointTests/ApiIntegrationTestBase.cs +++ b/tests/Tests/Framework/EndpointTests/ApiIntegrationTestBase.cs @@ -42,7 +42,7 @@ [I] public virtual async Task ReturnsExpectedIsValid() => protected override Task AssertOnAllResponses(Action assert) => base.AssertOnAllResponses(r => { - if (TestClient.Configuration.RunIntegrationTests && !r.IsValid && r.ApiCallDetails.OriginalException != null + if (TestClient.Configuration.RunIntegrationTests && !r.IsValidResponse && r.ApiCallDetails.OriginalException != null && r.ApiCallDetails.OriginalException is not TransportException) { var e = ExceptionDispatchInfo.Capture(r.ApiCallDetails.OriginalException.Demystify()); @@ -90,7 +90,7 @@ public virtual async Task ReturnsExpectedIsValid() => protected override Task AssertOnAllResponses(Action assert) => base.AssertOnAllResponses(r => { - if (TestClient.Configuration.RunIntegrationTests && !r.IsValid && r.ApiCallDetails.OriginalException != null + if (TestClient.Configuration.RunIntegrationTests && !r.IsValidResponse && r.ApiCallDetails.OriginalException != null && r.ApiCallDetails.OriginalException is not TransportException) { var e = ExceptionDispatchInfo.Capture(r.ApiCallDetails.OriginalException.Demystify()); diff --git a/tests/Tests/Framework/EndpointTests/CoordinatedIntegrationTestBase.cs b/tests/Tests/Framework/EndpointTests/CoordinatedIntegrationTestBase.cs index fb55034b938..cd19c00312c 100644 --- a/tests/Tests/Framework/EndpointTests/CoordinatedIntegrationTestBase.cs +++ b/tests/Tests/Framework/EndpointTests/CoordinatedIntegrationTestBase.cs @@ -70,7 +70,7 @@ private async Task AssertOnAllResponses(string name, LazyResponses re throw new Exception($"{name} is not a request observed and so no call isolated values could be located for it"); var r = response; - if (TestClient.Configuration.RunIntegrationTests && !r.IsValid && r.ApiCallDetails.OriginalException != null + if (TestClient.Configuration.RunIntegrationTests && !r.IsValidResponse && r.ApiCallDetails.OriginalException != null && r.ApiCallDetails.OriginalException is not TransportException) { var e = ExceptionDispatchInfo.Capture(r.ApiCallDetails.OriginalException.Demystify()); diff --git a/tests/Tests/Framework/EndpointTests/TestState/EndpointUsage.cs b/tests/Tests/Framework/EndpointTests/TestState/EndpointUsage.cs index 496bdc84e6d..fa4a28b2c06 100644 --- a/tests/Tests/Framework/EndpointTests/TestState/EndpointUsage.cs +++ b/tests/Tests/Framework/EndpointTests/TestState/EndpointUsage.cs @@ -141,7 +141,7 @@ public async Task AssertOnAllResponses(Action assert) var r = kv.Value as TResponse; //this is to make sure any unexpected exceptions on the response are rethrown and shown during testing - if (TestClient.Configuration.RunIntegrationTests && !r.IsValid && r.ApiCallDetails.OriginalException != null + if (TestClient.Configuration.RunIntegrationTests && !r.IsValidResponse && r.ApiCallDetails.OriginalException != null && r.ApiCallDetails.OriginalException is not TransportException) { var e = ExceptionDispatchInfo.Capture(r.ApiCallDetails.OriginalException.Demystify()); diff --git a/tests/Tests/IndexManagement/Mapping/GetMappingApiTests.cs b/tests/Tests/IndexManagement/Mapping/GetMappingApiTests.cs index 062be3c4e34..a2946fe0363 100644 --- a/tests/Tests/IndexManagement/Mapping/GetMappingApiTests.cs +++ b/tests/Tests/IndexManagement/Mapping/GetMappingApiTests.cs @@ -77,6 +77,6 @@ protected override LazyResponses ClientUsage() => Calls( protected override void ExpectResponse(MappingResponse response) { response.Indices.Should().BeEmpty(); - response.ServerError.Should().NotBeNull(); + response.ElasticsearchServerError.Should().NotBeNull(); } } diff --git a/tests/Tests/Search/Scroll/ClearScroll/ClearScrollApiTests.cs b/tests/Tests/Search/Scroll/ClearScroll/ClearScrollApiTests.cs index 28af7368cd7..da43634d755 100644 --- a/tests/Tests/Search/Scroll/ClearScroll/ClearScrollApiTests.cs +++ b/tests/Tests/Search/Scroll/ClearScroll/ClearScrollApiTests.cs @@ -47,7 +47,7 @@ protected override void OnBeforeCall(ElasticsearchClient client) { var searchResponse = Client.Search(s => s.Query(q => q.MatchAll()).Scroll(TimeSpan.FromMinutes(1))); - if (!searchResponse.IsValid) + if (!searchResponse.IsValidResponse) throw new Exception("Setup: Initial scroll failed."); _scrollId = searchResponse.ScrollId ?? _scrollId; diff --git a/tests/Tests/Search/Scroll/Scroll/ScrollApiTests.cs b/tests/Tests/Search/Scroll/Scroll/ScrollApiTests.cs index 389718745bf..8e4aaa21a18 100644 --- a/tests/Tests/Search/Scroll/Scroll/ScrollApiTests.cs +++ b/tests/Tests/Search/Scroll/Scroll/ScrollApiTests.cs @@ -44,7 +44,7 @@ protected override LazyResponses ClientUsage() => Calls( protected override void OnBeforeCall(ElasticsearchClient client) { var response = client.Search(s => s.Query(q => q.MatchAll()).Scroll(TimeSpan.FromMinutes(1))); - if (!response.IsValid) + if (!response.IsValidResponse) throw new Exception("Scroll setup failed"); _scrollId = response.ScrollId ?? _scrollId; diff --git a/tests/Tests/Search/Scroll/Scroll/SlicedScrollSearchApiTests.cs b/tests/Tests/Search/Scroll/Scroll/SlicedScrollSearchApiTests.cs index 9fa04955b63..322a64ad168 100644 --- a/tests/Tests/Search/Scroll/Scroll/SlicedScrollSearchApiTests.cs +++ b/tests/Tests/Search/Scroll/Scroll/SlicedScrollSearchApiTests.cs @@ -57,7 +57,7 @@ protected override void OnBeforeCall(ElasticsearchClient client) SortOptions.Field("_doc", new FieldSort { Order = SortOrder.Asc }) }) ); - if (!response.IsValid) + if (!response.IsValidResponse) throw new Exception("Scroll setup failed"); _scrollId = response.ScrollId ?? _scrollId; diff --git a/tests/Tests/Sql/ClearSqlCursorApiTests.cs b/tests/Tests/Sql/ClearSqlCursorApiTests.cs index 95053968c64..21c0d56e839 100644 --- a/tests/Tests/Sql/ClearSqlCursorApiTests.cs +++ b/tests/Tests/Sql/ClearSqlCursorApiTests.cs @@ -50,7 +50,7 @@ protected override LazyResponses ClientUsage() => Calls( protected override void OnBeforeCall(ElasticsearchClient client) { var sqlQueryResponse = Client.Sql.Query(q => q.Query(SqlQuery).FetchSize(5)); - if (!sqlQueryResponse.IsValid) + if (!sqlQueryResponse.IsValidResponse) throw new Exception("Setup: Initial scroll failed."); _currentCursor = sqlQueryResponse.Cursor ?? _currentCursor; diff --git a/tests/Tests/Tests.csproj b/tests/Tests/Tests.csproj index 7b566bf90fa..aa817fdf9c8 100644 --- a/tests/Tests/Tests.csproj +++ b/tests/Tests/Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/tests/Tests/packages.lock.json b/tests/Tests/packages.lock.json index 7b928a42cf8..94d233ae460 100644 --- a/tests/Tests/packages.lock.json +++ b/tests/Tests/packages.lock.json @@ -31,11 +31,11 @@ }, "Elastic.Transport.VirtualizedCluster": { "type": "Direct", - "requested": "[0.4.0, )", - "resolved": "0.4.0", - "contentHash": "ayBs9J8+bi1hrlk3+kzlzfur9fTrRskz/IVQfNvxs74SP5gEaxiBp69V4r2WE6cVoZKJa583jyP5vb/yKk/lCg==", + "requested": "[0.4.2, )", + "resolved": "0.4.2", + "contentHash": "tyPrSQqfEPQjHVWDpZ+NbnuI4i6S5DXPQeJvgoqpHdD8l8g+3Luv3/0bRIms6L1neSzXZ+riPtHS9muGNV/1pQ==", "dependencies": { - "Elastic.Transport": "0.4.0" + "Elastic.Transport": "0.4.2" } }, "FSharp.Core": { @@ -195,8 +195,8 @@ }, "Elastic.Transport": { "type": "Transitive", - "resolved": "0.4.0", - "contentHash": "4uqaeeZOboqs8nSvYnQXnGOSTyPo4SvV4NH3o+Ls3OEV1d9VipYS09/8/DcmcklK7hWuQXhrdsQd1b6Vi0a//w==", + "resolved": "0.4.2", + "contentHash": "umDR9uAzO8KPgb96O6llqN7DIv7oqATB4MPr3UrDCJ6Su+l7KJhB7lwItf/cw727e1jKTG9QEqkW6tBGjYoe4w==", "dependencies": { "Microsoft.CSharp": "4.7.0", "System.Buffers": "4.5.1", @@ -1492,7 +1492,7 @@ "elastic.clients.elasticsearch": { "type": "Project", "dependencies": { - "Elastic.Transport": "[0.4.0, )" + "Elastic.Transport": "[0.4.2, )" } }, "elastic.clients.elasticsearch.jsonnetserializer": {