Search in sources :

Example 1 with MockEngineFactory

use of org.opensearch.test.engine.MockEngineFactory in project OpenSearch by opensearch-project.

the class IndexModuleTests method testWrapperIsBound.

public void testWrapperIsBound() throws IOException {
    final MockEngineFactory engineFactory = new MockEngineFactory(AssertingDirectoryReader.class);
    IndexModule module = new IndexModule(indexSettings, emptyAnalysisRegistry, engineFactory, new EngineConfigFactory(indexSettings), Collections.emptyMap(), () -> true, new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), Collections.emptyMap());
    module.setReaderWrapper(s -> new Wrapper());
    IndexService indexService = newIndexService(module);
    assertTrue(indexService.getReaderWrapper() instanceof Wrapper);
    assertSame(indexService.getEngineFactory(), module.getEngineFactory());
    indexService.close("simon says", false);
}
Also used : MockEngineFactory(org.opensearch.test.engine.MockEngineFactory) EngineConfigFactory(org.opensearch.index.engine.EngineConfigFactory) ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver)

Aggregations

IndexNameExpressionResolver (org.opensearch.cluster.metadata.IndexNameExpressionResolver)1 ThreadContext (org.opensearch.common.util.concurrent.ThreadContext)1 EngineConfigFactory (org.opensearch.index.engine.EngineConfigFactory)1 MockEngineFactory (org.opensearch.test.engine.MockEngineFactory)1