Merge branch 'pr/tests-azure-repo'

This commit is contained in:
David Pilato 2016-01-19 17:07:59 +01:00
commit d6e6ef4ec4
1 changed files with 17 additions and 0 deletions

View File

@ -61,6 +61,16 @@ public class AzureStorageServiceTest extends ESTestCase {
assertThat(client.getEndpoint(), is(URI.create("https://azure1")));
}
public void testGetDefaultClientWithNoSecondary() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(Settings.builder()
.put("cloud.azure.storage.azure1.account", "myaccount1")
.put("cloud.azure.storage.azure1.key", "mykey1")
.build());
azureStorageService.doStart();
CloudBlobClient client = azureStorageService.getSelectedClient(null, LocationMode.PRIMARY_ONLY);
assertThat(client.getEndpoint(), is(URI.create("https://azure1")));
}
public void testGetSelectedClientPrimary() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(settings);
azureStorageService.doStart();
@ -82,6 +92,13 @@ public class AzureStorageServiceTest extends ESTestCase {
assertThat(client.getEndpoint(), is(URI.create("https://azure3")));
}
public void testGetDefaultClientWithPrimaryAndSecondaries() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(settings);
azureStorageService.doStart();
CloudBlobClient client = azureStorageService.getSelectedClient(null, LocationMode.PRIMARY_ONLY);
assertThat(client.getEndpoint(), is(URI.create("https://azure1")));
}
public void testGetSelectedClientNonExisting() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(settings);
azureStorageService.doStart();