Skip to content

Commit a0e6912

Browse files
committed
Add json tests for scroll and clear scroll
1 parent 57ab863 commit a0e6912

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/Tests/Search/Scroll/ClearScroll/ClearScrollApiTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,20 @@ protected override LazyResponses ClientUsage() => Calls(
2222
requestAsync: (c, r) => c.ClearScrollAsync(r)
2323
);
2424

25+
protected override object ExpectJson => new
26+
{
27+
scroll_id = new []
28+
{
29+
_scrollId
30+
}
31+
};
32+
2533
protected override int ExpectStatusCode => 200;
2634
protected override bool ExpectIsValid => true;
2735
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
2836
protected override string UrlPath => $"/_search/scroll";
37+
protected override bool SupportsDeserialization => false;
38+
2939

3040
protected override ClearScrollDescriptor NewDescriptor() => new ClearScrollDescriptor();
3141

src/Tests/Search/Scroll/Scroll/ScrollApiTests.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ protected override LazyResponses ClientUsage() => Calls(
2222
requestAsync: (c, r) => c.ScrollAsync<Project>(r)
2323
);
2424

25+
protected override object ExpectJson => new
26+
{
27+
scroll = "1m",
28+
scroll_id = _scrollId
29+
};
30+
2531
protected override int ExpectStatusCode => 200;
2632
protected override bool ExpectIsValid => true;
2733
protected override HttpMethod HttpMethod => HttpMethod.POST;
2834
protected override string UrlPath => $"/_search/scroll";
35+
protected override bool SupportsDeserialization => false;
2936

30-
protected override ScrollDescriptor<Project> NewDescriptor() => new ScrollDescriptor<Project>();
31-
32-
protected override Func<ScrollDescriptor<Project>, IScrollRequest> Fluent => null;
37+
protected override Func<ScrollDescriptor<Project>, IScrollRequest> Fluent => s => s.Scroll("1m").ScrollId(_scrollId);
3338

3439
protected override ScrollRequest Initializer => new ScrollRequest(_scrollId, "1m");
3540

0 commit comments

Comments
 (0)