summaryrefslogtreecommitdiff
path: root/plugins/repository-azure
diff options
context:
space:
mode:
authorRyan Ernst <ryan@iernst.net>2016-03-24 11:54:05 -0700
committerRyan Ernst <ryan@iernst.net>2016-03-24 11:54:05 -0700
commit3adaf096758a6015ca4f733e2e49ee5528ac3cd5 (patch)
tree1c8091bd151217804c6c6de9ddaa738a0ed16b67 /plugins/repository-azure
parent08903f1ed881cfe392e45d4c0f764f8a95bddf47 (diff)
Settings: Cleanup placeholder replacement
This change moves placeholder replacement to a pkg private class for settings. It also adds a null check when calling replacement, as settings objects can still contain null values, because we only prohibit nulls on file loading. Finally, this cleans up file and stream loading a bit to not have unnecessary exception wrapping.
Diffstat (limited to 'plugins/repository-azure')
-rw-r--r--plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureWithThirdPartyTestCase.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureWithThirdPartyTestCase.java b/plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureWithThirdPartyTestCase.java
index b7c2d373a5..7136befeaf 100644
--- a/plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureWithThirdPartyTestCase.java
+++ b/plugins/repository-azure/src/test/java/org/elasticsearch/cloud/azure/AbstractAzureWithThirdPartyTestCase.java
@@ -27,6 +27,7 @@ import org.elasticsearch.plugin.repository.azure.AzureRepositoryPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase.ThirdParty;
+import java.io.IOException;
import java.util.Collection;
/**
@@ -58,7 +59,11 @@ public abstract class AbstractAzureWithThirdPartyTestCase extends AbstractAzureT
// 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");
}