Skip to content

Commit

Permalink
Fix SingleDimensionValuesSourceTests
Browse files Browse the repository at this point in the history
Can no longer mock IndexReader as it's sealed.

Signed-off-by: Michael Froh <[email protected]>
  • Loading branch information
msfroh committed Dec 17, 2024
1 parent 67d17c1 commit 15dd0e8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
package org.opensearch.search.aggregations.bucket.composite;

import org.apache.lucene.document.LongPoint;
import org.apache.lucene.index.CompositeReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BoostQuery;
Expand Down Expand Up @@ -279,7 +280,7 @@ public void testNumericSorted() {
}

private static IndexReader mockIndexReader(int maxDoc, int numDocs) {
IndexReader reader = mock(IndexReader.class);
CompositeReader reader = mock(CompositeReader.class);
when(reader.hasDeletions()).thenReturn(maxDoc - numDocs > 0);
when(reader.maxDoc()).thenReturn(maxDoc);
when(reader.numDocs()).thenReturn(numDocs);
Expand Down

0 comments on commit 15dd0e8

Please sign in to comment.