-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor out test-only extension runner contructor
- Loading branch information
Showing
8 changed files
with
57 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/test/java/org/opensearch/sdk/ExtensionsRunnerForTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.opensearch.sdk; | ||
|
||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* An Extension Runner for testing using test settings. | ||
*/ | ||
public class ExtensionsRunnerForTest extends ExtensionsRunner { | ||
|
||
private static final String EXTENSION_DESCRIPTOR = "src/test/resources/extension.yml"; | ||
|
||
/** | ||
* Instantiates a new Extensions Runner using test settings. | ||
* | ||
* @throws IOException if the runner failed to read settings or API. | ||
*/ | ||
public ExtensionsRunnerForTest() throws IOException { | ||
super(new Extension() { | ||
@Override | ||
public ExtensionSettings getExtensionSettings() { | ||
return new ExtensionSettings("sample-extension", "127.0.0.1", "4532"); | ||
} | ||
|
||
@Override | ||
public List<ExtensionRestHandler> getExtensionRestHandlers() { | ||
return Collections.emptyList(); | ||
} | ||
}); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters