Skip to content

Commit c9bcf09

Browse files
committed
Add doc’s sequence number + primary term to get responses #3767
1 parent 1e6890f commit c9bcf09

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/Tests/Tests/Document/Multiple/MultiGet/MultiGetApiTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,11 @@ protected override void ExpectResponse(MultiGetResponse response)
168168
hit.Id.Should().NotBeNullOrWhiteSpace();
169169
hit.Found.Should().BeTrue();
170170
hit.Version.Should().Be(1);
171-
hit.SequenceNumber.Should().HaveValue();
172-
hit.PrimaryTerm.Should().HaveValue();
171+
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
172+
{
173+
hit.PrimaryTerm.Should().BeGreaterOrEqualTo(1);
174+
hit.SequenceNumber.Should().BeGreaterOrEqualTo(0);
175+
}
173176
hit.Source.ShouldAdhereToSourceSerializerWhenSet();
174177
}
175178
}

src/Tests/Tests/Document/Single/DocumentCrudTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ [I] protected async Task DocumentIsUpdated() => await AssertOnGetAfterUpdate(r =
7878
{
7979
r.Source.Should().NotBeNull();
8080
r.Version.Should().BeGreaterThan(1);
81+
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
82+
{
83+
r.SequenceNumber.Should().BeGreaterOrEqualTo(1);
84+
r.PrimaryTerm.Should().BeGreaterThan(0);
85+
}
8186
r.Source.Description.Should().EndWith("updated");
8287
});
8388

src/Tests/Tests/Document/Single/Get/GetApiTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ protected override void ExpectResponse(GetResponse<Project> response)
4747
response.SequenceNumber.Should().HaveValue();
4848
response.PrimaryTerm.Should().HaveValue();
4949
response.Source.ShouldAdhereToSourceSerializerWhenSet();
50+
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
51+
{
52+
response.SequenceNumber.Should().BeGreaterOrEqualTo(0);
53+
response.PrimaryTerm.Should().BeGreaterOrEqualTo(1);
54+
}
5055
}
5156
}
5257

0 commit comments

Comments
 (0)