Skip to content

Commit 7741566

Browse files
committed
fix mocking in more unit tests
1 parent a177f8a commit 7741566

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

plugins/mapper-murmur3/src/test/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapperTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ protected void assertFetch(MapperService mapperService, String field, Object val
9999
.build(new IndexFieldDataCache.None(), new NoneCircuitBreakerService())
100100
);
101101
SearchExecutionContext searchExecutionContext = mock(SearchExecutionContext.class);
102+
when(searchExecutionContext.getIndexSettings()).thenReturn(mapperService.getIndexSettings());
102103
when(searchExecutionContext.isSourceEnabled()).thenReturn(true);
103104
when(searchExecutionContext.sourcePath(field)).thenReturn(Set.of(field));
104105
when(searchExecutionContext.getForField(ft, fdt)).thenAnswer(inv -> fieldDataLookup(mapperService).apply(ft, () -> {

x-pack/plugin/rank-vectors/src/test/java/org/elasticsearch/xpack/rank/vectors/mapper/RankVectorsFieldMapperTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ protected void assertFetch(MapperService mapperService, String field, Object val
374374
MappedFieldType.FielddataOperation fdt = MappedFieldType.FielddataOperation.SEARCH;
375375
SourceToParse source = source(b -> b.field(ft.name(), value));
376376
SearchExecutionContext searchExecutionContext = mock(SearchExecutionContext.class);
377+
when(searchExecutionContext.getIndexSettings()).thenReturn(mapperService.getIndexSettings());
377378
when(searchExecutionContext.isSourceEnabled()).thenReturn(true);
378379
when(searchExecutionContext.sourcePath(field)).thenReturn(Set.of(field));
379380
when(searchExecutionContext.getForField(ft, fdt)).thenAnswer(inv -> fieldDataLookup(mapperService).apply(ft, () -> {

0 commit comments

Comments
 (0)