11using System ;
2+ using System . Collections . Generic ;
3+ using Elasticsearch . Net ;
24using FluentAssertions ;
5+ using Nest ;
36using Tests . Framework ;
47using Tests . Framework . ManagedElasticsearch . Clusters ;
58using Tests . Framework . MockData ;
69using Xunit ;
10+ using static Nest . Infer ;
711
812namespace Tests . ClientConcepts . Troubleshooting
913{
@@ -19,16 +23,34 @@ public class DeprecationLogging : IntegrationDocumentationTestBase, IClusterFixt
1923 {
2024 public DeprecationLogging ( ReadOnlyCluster cluster ) : base ( cluster ) { }
2125
22- [ I ( Skip = "6.0.0-rc1" ) ] public void RequestWithMultipleWarning ( )
26+ [ I ] public void RequestWithMultipleWarning ( )
2327 {
24- //TODO come up with a new deprecation test since fielddata is gone
25- throw new NotImplementedException ( ) ;
26-
27- var response = this . Client . Search < Project > ( s => s ) ;
28+ var request = new SearchRequest < Project >
29+ {
30+ Size = 0 ,
31+ Routing = new [ ] { "ignoredefaultcompletedhandler" } ,
32+ Aggregations = new TermsAggregation ( "states" )
33+ {
34+ Field = Field < Project > ( p => p . State . Suffix ( "keyword" ) ) ,
35+ Order = new List < TermsOrder >
36+ {
37+ new TermsOrder { Key = "_term" , Order = SortOrder . Ascending } ,
38+ }
39+ } ,
40+ Query = new FunctionScoreQuery ( )
41+ {
42+ Query = new MatchAllQuery { } ,
43+ Functions = new List < IScoreFunction >
44+ {
45+ new RandomScoreFunction { Seed = 1337 } ,
46+ }
47+ }
48+ } ;
49+ var response = this . Client . Search < Project > ( request ) ;
2850
2951 response . ApiCall . DeprecationWarnings . Should ( ) . NotBeNullOrEmpty ( ) ;
30-
31- response . DebugInformation . Should ( ) . Contain ( "Server indicated deprecations: " ) ; // <1> `DebugInformation` also contains the deprecation warnings
52+ response . ApiCall . DeprecationWarnings . Should ( ) . HaveCount ( 2 ) ;
53+ response . DebugInformation . Should ( ) . Contain ( "Deprecated aggregation order key " ) ; // <1> `DebugInformation` also contains the deprecation warnings
3254 }
3355 }
3456}
0 commit comments