Skip to content

Commit 49a2804

Browse files
committed
fixed mocking
1 parent 45fd95e commit 49a2804

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SecurityIndexReaderWrapperUnitTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.index.mapper.FieldNamesFieldMapper;
1818
import org.elasticsearch.index.mapper.SeqNoFieldMapper;
1919
import org.elasticsearch.index.mapper.SourceFieldMapper;
20+
import org.elasticsearch.index.query.SearchExecutionContext;
2021
import org.elasticsearch.index.shard.IndexShard;
2122
import org.elasticsearch.index.shard.ShardId;
2223
import org.elasticsearch.indices.IndicesModule;
@@ -86,7 +87,14 @@ public void tearDown() throws Exception {
8687
}
8788

8889
public void testDefaultMetaFields() throws Exception {
89-
securityIndexReaderWrapper = new SecurityIndexReaderWrapper(null, null, securityContext, licenseState, scriptService) {
90+
var searchExecutionContext = mock(SearchExecutionContext.class);
91+
securityIndexReaderWrapper = new SecurityIndexReaderWrapper(
92+
id -> searchExecutionContext,
93+
null,
94+
securityContext,
95+
licenseState,
96+
scriptService
97+
) {
9098
@Override
9199
protected IndicesAccessControl getIndicesAccessControl() {
92100
IndicesAccessControl.IndexAccessControl indexAccessControl = new IndicesAccessControl.IndexAccessControl(

0 commit comments

Comments
 (0)