@@ -46,6 +46,9 @@ public TermsListOfListIntegrationTests(ReadOnlyCluster cluster, EndpointUsage us
4646
4747 private List < List < string > > _terms = new List < List < string > > { new List < string > { "term1" , "term2" } } ;
4848
49+ protected override int ExpectStatusCode => 400 ;
50+ protected override bool ExpectIsValid => false ;
51+
4952 protected override object QueryJson => new
5053 {
5154 terms = new
@@ -72,6 +75,18 @@ protected override QueryContainer QueryFluent(QueryContainerDescriptor<Project>
7275 . Terms ( _terms )
7376 ) ;
7477
78+ protected override void ExpectResponse ( ISearchResponse < Project > response )
79+ {
80+ response . IsValid . Should ( ) . BeFalse ( ) ;
81+
82+ response . ServerError . Should ( ) . NotBeNull ( ) ;
83+ response . ServerError . Status . Should ( ) . Be ( 400 ) ;
84+ response . ServerError . Error . Should ( ) . NotBeNull ( ) ;
85+ var rootCauses = response . ServerError . Error . RootCause ;
86+ rootCauses . Should ( ) . NotBeNullOrEmpty ( ) ;
87+ var rootCause = rootCauses . First ( ) ;
88+ rootCause . Type . Should ( ) . Be ( "parsing_exception" ) ;
89+ }
7590 }
7691
7792 public class TermsListOfListStringAgainstNumericFieldIntegrationTests : QueryDslIntegrationTestsBase
@@ -110,16 +125,16 @@ protected override QueryContainer QueryFluent(QueryContainerDescriptor<Project>
110125 . Terms ( _terms )
111126 ) ;
112127
113- [ I ] public Task AsserResponse ( ) => AssertOnAllResponses ( r =>
128+ protected override void ExpectResponse ( ISearchResponse < Project > response )
114129 {
115- r . ServerError . Should ( ) . NotBeNull ( ) ;
116- r . ServerError . Status . Should ( ) . Be ( 400 ) ;
117- r . ServerError . Error . Should ( ) . NotBeNull ( ) ;
118- var rootCauses = r . ServerError . Error . RootCause ;
130+ response . ServerError . Should ( ) . NotBeNull ( ) ;
131+ response . ServerError . Status . Should ( ) . Be ( 400 ) ;
132+ response . ServerError . Error . Should ( ) . NotBeNull ( ) ;
133+ var rootCauses = response . ServerError . Error . RootCause ;
119134 rootCauses . Should ( ) . NotBeNullOrEmpty ( ) ;
120135 var rootCause = rootCauses . First ( ) ;
121- rootCause . Type . Should ( ) . Be ( "number_format_exception " ) ;
122- } ) ;
136+ rootCause . Type . Should ( ) . Be ( "parsing_exception " ) ;
137+ }
123138
124139 }
125140
0 commit comments