mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
Fix uncaught checked exception in AzureTestUtils
This commit fixes an uncaught checked IOException now thrown in AzureTestUtils after 3adaf096758a6015ca4f733e2e49ee5528ac3cd5.
This commit is contained in:
parent
bbd5f26d45
commit
974c753bf6
@ -24,6 +24,8 @@ import org.elasticsearch.common.io.PathUtils;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class AzureTestUtils {
|
||||
/**
|
||||
* Read settings from file when running integration tests with ThirdParty annotation.
|
||||
@ -36,7 +38,11 @@ public class AzureTestUtils {
|
||||
// if explicit, just load it and don't load from env
|
||||
try {
|
||||
if (Strings.hasText(System.getProperty("tests.config"))) {
|
||||
settings.loadFromPath(PathUtils.get((System.getProperty("tests.config"))));
|
||||
try {
|
||||
settings.loadFromPath(PathUtils.get((System.getProperty("tests.config"))));
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException("could not load azure tests config", e);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException("to run integration tests, you need to set -Dtests.thirdparty=true and " +
|
||||
"-Dtests.config=/path/to/elasticsearch.yml");
|
||||
|
Loading…
x
Reference in New Issue
Block a user