Skip to content

Commit

Permalink
Move getEngineFactory test
Browse files Browse the repository at this point in the history
Signed-off-by: John Mazanec <jmazane@amazon.com>
  • Loading branch information
jmazanec15 committed Mar 11, 2022
1 parent 9e10d0e commit 98f2f5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ public void testCreateCodecServiceFromFactory() {
assertNotNull(config.getCodec());
}

public void testGetEngineFactory() {
final EngineFactory engineFactory = config -> null;
EnginePlugin enginePluginThatImplementsGetEngineFactory = new EnginePlugin() {
@Override
public Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings) {
return Optional.of(engineFactory);
}
};
assertEquals(engineFactory, enginePluginThatImplementsGetEngineFactory.getEngineFactory(null).orElse(null));

EnginePlugin enginePluginThatDoesNotImplementsGetEngineFactory = new EnginePlugin() {
};
assertFalse(enginePluginThatDoesNotImplementsGetEngineFactory.getEngineFactory(null).isPresent());
}

private static class FooEnginePlugin extends Plugin implements EnginePlugin {
@Override
public Optional<EngineFactory> getEngineFactory(final IndexSettings indexSettings) {
Expand Down
33 changes: 0 additions & 33 deletions server/src/test/java/org/opensearch/plugins/EnginePluginTests.java

This file was deleted.

0 comments on commit 98f2f5e

Please sign in to comment.