diff --git a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/CompoundAnalysisTests.java b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/CompoundAnalysisTests.java index 385b8c0f041f4..54ee8587f0afe 100644 --- a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/CompoundAnalysisTests.java +++ b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/CompoundAnalysisTests.java @@ -72,7 +72,9 @@ public class CompoundAnalysisTests extends OpenSearchTestCase { @Before public void initialize() throws IOException { - this.settingsArr = getSettingsArr(); + final Path home = createTempDir(); + copyHyphenationPatternsFile(home); + this.settingsArr = new Settings[] { getJsonSettings(home), getYamlSettings(home) }; } public void testDefaultsCompoundAnalysis() throws Exception { @@ -143,10 +145,6 @@ public Map> getTokenFilters() { })); } - private Path createAndGetHomeDirectory() throws IOException { - return createTempDir(); - } - private void copyHyphenationPatternsFile(Path home) throws IOException { InputStream hyphenation_patterns_path = getClass().getResourceAsStream("da_UTF8.xml"); Path config = home.resolve("config"); @@ -171,10 +169,4 @@ private Settings getYamlSettings(Path home) throws IOException { .put(Environment.PATH_HOME_SETTING.getKey(), home.toString()) .build(); } - - private Settings[] getSettingsArr() throws IOException { - Path home = createAndGetHomeDirectory(); - copyHyphenationPatternsFile(home); - return new Settings[] { getJsonSettings(home), getYamlSettings(home) }; - } }