Skip to content

Commit 7c24e7c

Browse files
committed
Fix failing search shards url tests from bad cherry-pick
1 parent 8eb2dc3 commit 7c24e7c

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

src/Tests/Search/SearchShards/SearchShardsUrlTests.cs

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,48 @@ public class SearchShardsUrlTests
1111
[U] public async Task Urls()
1212
{
1313
var hardcoded = "hardcoded";
14+
await POST("/project/commits/_search_shards")
15+
.Fluent(c=>c.SearchShards<CommitActivity>(s=>s))
16+
.Request(c=>c.SearchShards(new SearchShardsRequest<CommitActivity>()))
17+
.FluentAsync(c=>c.SearchShardsAsync<CommitActivity>(s=>s))
18+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<CommitActivity>()))
19+
;
20+
21+
await POST("/project/hardcoded/_search_shards")
22+
.Fluent(c=>c.SearchShards<CommitActivity>(s=>s.Type(hardcoded)))
23+
.Request(c=>c.SearchShards(new SearchShardsRequest<CommitActivity>(typeof(Project), hardcoded)))
24+
.Request(c=>c.SearchShards(new SearchShardsRequest(typeof(Project), hardcoded)))
25+
.FluentAsync(c=>c.SearchShardsAsync<CommitActivity>(s=>s.Type(hardcoded)))
26+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<CommitActivity>(typeof(Project), hardcoded)))
27+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest(typeof(Project), hardcoded)))
28+
;
29+
1430
await POST("/project/_search_shards")
31+
.Fluent(c=>c.SearchShards<Project>(s=>s.Type(Types.All)))
32+
.Fluent(c=>c.SearchShards<Project>(s=>s.AllTypes()))
1533
.Request(c=>c.SearchShards(new SearchShardsRequest("project")))
16-
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>(typeof(Project))))
17-
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(typeof(Project))))
18-
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Index<Project>()))
34+
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>("project", Types.All)))
35+
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Type(Types.All)))
36+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(typeof(Project), Types.All)))
37+
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.AllTypes()))
1938
;
2039

2140
await POST("/hardcoded/_search_shards")
41+
.Fluent(c=>c.SearchShards<Project>(s=>s.Index(hardcoded).Type(Types.All)))
42+
.Fluent(c=>c.SearchShards<Project>(s=>s.Index(hardcoded).AllTypes()))
2243
.Request(c=>c.SearchShards(new SearchShardsRequest(hardcoded)))
23-
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>(hardcoded)))
24-
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Index(hardcoded)))
25-
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(hardcoded)))
26-
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Index(hardcoded)))
44+
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>(hardcoded, Types.All)))
45+
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Index(hardcoded).Type(Types.All)))
46+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(hardcoded, Types.All)))
47+
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.Index(hardcoded).AllTypes()))
2748
;
2849

2950
await POST("/_search_shards")
30-
.Fluent(c=>c.SearchShards<Project>(s=>s.AllIndices()))
51+
.Fluent(c=>c.SearchShards<Project>(s=>s.AllTypes().AllIndices()))
3152
.Request(c=>c.SearchShards(new SearchShardsRequest()))
32-
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>(Nest.Indices.All)))
33-
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.AllIndices()))
34-
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(Nest.Indices.All)))
53+
.Request(c=>c.SearchShards(new SearchShardsRequest<Project>(Nest.Indices.All, Types.All)))
54+
.FluentAsync(c=>c.SearchShardsAsync<Project>(s=>s.AllIndices().Type(Types.All)))
55+
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest<Project>(Nest.Indices.All, Types.All)))
3556
.RequestAsync(c=>c.SearchShardsAsync(new SearchShardsRequest()))
3657
;
3758
}

0 commit comments

Comments
 (0)