Search in sources :

Example 1 with AzureStorageSettings

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"));
}
Also used : AzureStorageSettings(org.elasticsearch.cloud.azure.storage.AzureStorageSettings) Map(java.util.Map) Settings(org.elasticsearch.common.settings.Settings) AzureStorageSettings(org.elasticsearch.cloud.azure.storage.AzureStorageSettings)

Example 2 with AzureStorageSettings

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));
}
Also used : AzureStorageSettings(org.elasticsearch.cloud.azure.storage.AzureStorageSettings) Map(java.util.Map) Settings(org.elasticsearch.common.settings.Settings) AzureStorageSettings(org.elasticsearch.cloud.azure.storage.AzureStorageSettings)

Aggregations

Map (java.util.Map)2 AzureStorageSettings (org.elasticsearch.cloud.azure.storage.AzureStorageSettings)2 Settings (org.elasticsearch.common.settings.Settings)2