Skip to content

Commit

Permalink
Add doc’s sequence number + primary term to get responses #3767
Browse files Browse the repository at this point in the history
  • Loading branch information
codebrain committed May 30, 2019
1 parent 1e6890f commit c9bcf09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ protected override void ExpectResponse(MultiGetResponse response)
hit.Id.Should().NotBeNullOrWhiteSpace();
hit.Found.Should().BeTrue();
hit.Version.Should().Be(1);
hit.SequenceNumber.Should().HaveValue();
hit.PrimaryTerm.Should().HaveValue();
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
{
hit.PrimaryTerm.Should().BeGreaterOrEqualTo(1);
hit.SequenceNumber.Should().BeGreaterOrEqualTo(0);
}
hit.Source.ShouldAdhereToSourceSerializerWhenSet();
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/Tests/Tests/Document/Single/DocumentCrudTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ [I] protected async Task DocumentIsUpdated() => await AssertOnGetAfterUpdate(r =
{
r.Source.Should().NotBeNull();
r.Version.Should().BeGreaterThan(1);
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
{
r.SequenceNumber.Should().BeGreaterOrEqualTo(1);
r.PrimaryTerm.Should().BeGreaterThan(0);
}
r.Source.Description.Should().EndWith("updated");
});

Expand Down
5 changes: 5 additions & 0 deletions src/Tests/Tests/Document/Single/Get/GetApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ protected override void ExpectResponse(GetResponse<Project> response)
response.SequenceNumber.Should().HaveValue();
response.PrimaryTerm.Should().HaveValue();
response.Source.ShouldAdhereToSourceSerializerWhenSet();
if (base.Cluster.ClusterConfiguration.Version >= "6.8.0")
{
response.SequenceNumber.Should().BeGreaterOrEqualTo(0);
response.PrimaryTerm.Should().BeGreaterOrEqualTo(1);
}
}
}

Expand Down

0 comments on commit c9bcf09

Please sign in to comment.