use of org.elasticsearch.cloud.azure.storage.AzureStorageSettings in project elasticsearch by elastic.
the class AzureSettingsParserTests method testParseTwoSettingsExplicitDefault.
public void testParseTwoSettingsExplicitDefault() {
Settings settings = Settings.builder().put("cloud.azure.storage.azure1.account", "myaccount1").put("cloud.azure.storage.azure1.key", "mykey1").put("cloud.azure.storage.azure1.default", true).put("cloud.azure.storage.azure2.account", "myaccount2").put("cloud.azure.storage.azure2.key", "mykey2").build();
Tuple<AzureStorageSettings, Map<String, AzureStorageSettings>> tuple = AzureStorageSettings.parse(settings);
assertThat(tuple.v1(), notNullValue());
assertThat(tuple.v1().getAccount(), is("myaccount1"));
assertThat(tuple.v1().getKey(), is("mykey1"));
assertThat(tuple.v2().keySet(), hasSize(1));
assertThat(tuple.v2().get("azure2"), notNullValue());
assertThat(tuple.v2().get("azure2").getAccount(), is("myaccount2"));
assertThat(tuple.v2().get("azure2").getKey(), is("mykey2"));
}
use of org.elasticsearch.cloud.azure.storage.AzureStorageSettings in project elasticsearch by elastic.
the class AzureSettingsParserTests method testParseUniqueSettings.
public void testParseUniqueSettings() {
Settings settings = Settings.builder().put("cloud.azure.storage.azure1.account", "myaccount1").put("cloud.azure.storage.azure1.key", "mykey1").build();
Tuple<AzureStorageSettings, Map<String, AzureStorageSettings>> tuple = AzureStorageSettings.parse(settings);
assertThat(tuple.v1(), notNullValue());
assertThat(tuple.v1().getAccount(), is("myaccount1"));
assertThat(tuple.v1().getKey(), is("mykey1"));
assertThat(tuple.v2().keySet(), hasSize(0));
}
Aggregations