Skip to content

Commit

Permalink
Fixing assert statements
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Jan 3, 2024
1 parent aa3ac06 commit 0065a1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ protected void doAssertLuceneQuery(SimpleQueryStringBuilder queryBuilder, Query
if (disjunct instanceof BoostQuery) {
termQuery = ((BoostQuery) disjunct).getQuery();
}
if (termQuery instanceof TermQuery) {
TermQuery inner = (TermQuery) termQuery;
if (termQuery instanceof TermQuery || termQuery instanceof IndexOrDocValuesQuery) {
TermQuery inner;
if (termQuery instanceof IndexOrDocValuesQuery) inner = (TermQuery) ((IndexOrDocValuesQuery) termQuery).getIndexQuery();
else inner = (TermQuery) termQuery;
assertThat(inner.getTerm().bytes().toString(), is(inner.getTerm().bytes().toString().toLowerCase(Locale.ROOT)));
} else {
assertThat(termQuery, instanceOf(MatchNoDocsQuery.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,6 @@ public void testKeywordSplitQueriesOnWhitespace() throws IOException {
),
0.0f
);
assertThat(query, equalTo(expected));
assertThat(expected, equalTo(query));
}
}

0 comments on commit 0065a1e

Please sign in to comment.