|
1 | | -using Elasticsearch.Net; |
| 1 | +using System; |
| 2 | +using Elasticsearch.Net; |
2 | 3 | using FluentAssertions; |
3 | 4 | using Nest; |
4 | 5 | using Tests.Framework; |
@@ -29,4 +30,39 @@ protected override void ExpectResponse(ICatResponse<CatHealthRecord> response) |
29 | 30 | } |
30 | 31 | } |
31 | 32 |
|
| 33 | + [Collection(TypeOfCluster.ReadOnly)] |
| 34 | + public class CatHealthNoTimestampApiTests : ApiIntegrationTestBase<ICatResponse<CatHealthRecord>, ICatHealthRequest, CatHealthDescriptor, CatHealthRequest> |
| 35 | + { |
| 36 | + public CatHealthNoTimestampApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } |
| 37 | + protected override LazyResponses ClientUsage() => Calls( |
| 38 | + fluent: (client, f) => client.CatHealth(f), |
| 39 | + fluentAsync: (client, f) => client.CatHealthAsync(f), |
| 40 | + request: (client, r) => client.CatHealth(r), |
| 41 | + requestAsync: (client, r) => client.CatHealthAsync(r) |
| 42 | + ); |
| 43 | + |
| 44 | + protected override bool ExpectIsValid => true; |
| 45 | + protected override int ExpectStatusCode => 200; |
| 46 | + protected override HttpMethod HttpMethod => HttpMethod.GET; |
| 47 | + protected override string UrlPath => "/_cat/health?ts=false"; |
| 48 | + |
| 49 | + protected override Func<CatHealthDescriptor, ICatHealthRequest> Fluent => s => s |
| 50 | + .Ts(false); |
| 51 | + |
| 52 | + protected override CatHealthRequest Initializer => new CatHealthRequest |
| 53 | + { |
| 54 | + Ts = false |
| 55 | + }; |
| 56 | + |
| 57 | + protected override void ExpectResponse(ICatResponse<CatHealthRecord> response) |
| 58 | + { |
| 59 | + response.Records.Should().NotBeEmpty().And.Contain(a => !string.IsNullOrEmpty(a.Status)); |
| 60 | + |
| 61 | + foreach (var record in response.Records) |
| 62 | + { |
| 63 | + record.Timestamp.Should().BeNullOrWhiteSpace(); |
| 64 | + } |
| 65 | + } |
| 66 | + } |
| 67 | + |
32 | 68 | } |
0 commit comments