|
146 | 146 | import org.elasticsearch.index.analysis.AnalysisRegistry; |
147 | 147 | import org.elasticsearch.index.mapper.MapperMetrics; |
148 | 148 | import org.elasticsearch.index.mapper.MapperRegistry; |
| 149 | +import org.elasticsearch.index.search.stats.ShardSearchLoadRateProvider; |
149 | 150 | import org.elasticsearch.index.seqno.GlobalCheckpointSyncAction; |
150 | 151 | import org.elasticsearch.index.seqno.RetentionLeaseSyncer; |
151 | 152 | import org.elasticsearch.index.shard.PrimaryReplicaSyncer; |
|
202 | 203 | import org.elasticsearch.xcontent.NamedXContentRegistry; |
203 | 204 | import org.junit.After; |
204 | 205 | import org.junit.Before; |
| 206 | +import org.mockito.Mockito; |
205 | 207 |
|
206 | 208 | import java.io.IOException; |
207 | 209 | import java.nio.file.Path; |
|
244 | 246 | import static org.hamcrest.Matchers.iterableWithSize; |
245 | 247 | import static org.hamcrest.Matchers.lessThanOrEqualTo; |
246 | 248 | import static org.hamcrest.Matchers.notNullValue; |
| 249 | +import static org.mockito.ArgumentMatchers.any; |
247 | 250 | import static org.mockito.Mockito.mock; |
| 251 | +import static org.mockito.Mockito.when; |
248 | 252 |
|
249 | 253 | public class SnapshotResiliencyTests extends ESTestCase { |
250 | 254 |
|
@@ -2217,8 +2221,12 @@ public RecyclerBytesStreamOutput newNetworkBytesStream() { |
2217 | 2221 | ); |
2218 | 2222 | final MapperRegistry mapperRegistry = new IndicesModule(Collections.emptyList()).getMapperRegistry(); |
2219 | 2223 |
|
| 2224 | + PluginsService pluginsService = Mockito.mock(PluginsService.class); |
| 2225 | + when(pluginsService.loadSingletonServiceProvider(any(), any())).thenReturn(ShardSearchLoadRateProvider.DEFAULT); |
| 2226 | + |
| 2227 | + |
2220 | 2228 | indicesService = new IndicesServiceBuilder().settings(settings) |
2221 | | - .pluginsService(mock(PluginsService.class)) |
| 2229 | + .pluginsService(pluginsService) |
2222 | 2230 | .nodeEnvironment(nodeEnv) |
2223 | 2231 | .xContentRegistry(namedXContentRegistry) |
2224 | 2232 | .analysisRegistry( |
|
0 commit comments