use of com.microsoft.azure.storage.blob.CloudBlobClient in project crate by crate.
the class AzureStorageServiceTests method testGetSelectedClientBackoffPolicyNbRetries.
public void testGetSelectedClientBackoffPolicyNbRetries() {
final Settings timeoutSettings = Settings.builder().put(buildClientCredSettings()).put("max_retries", 7).build();
final AzureStorageService azureStorageService = storageServiceWithSettings(timeoutSettings);
final CloudBlobClient client = azureStorageService.client().v1();
assertThat(client.getDefaultRequestOptions().getRetryPolicyFactory(), is(notNullValue()));
assertThat(client.getDefaultRequestOptions().getRetryPolicyFactory(), instanceOf(RetryExponentialRetry.class));
}
use of com.microsoft.azure.storage.blob.CloudBlobClient in project druid by druid-io.
the class AzureStorageDruidModuleTest method testGetAzureStorageContainerWithSASExpectedClient.
@Test
public void testGetAzureStorageContainerWithSASExpectedClient() {
Properties properties = initializePropertes();
properties.setProperty("druid.azure.sharedAccessStorageToken", AZURE_SHARED_ACCESS_TOKEN);
properties.remove("druid.azure.key");
injector = makeInjectorWithProperties(properties);
Supplier<CloudBlobClient> cloudBlobClient = injector.getInstance(Key.get(new TypeLiteral<Supplier<CloudBlobClient>>() {
}));
AzureAccountConfig azureAccountConfig = injector.getInstance(AzureAccountConfig.class);
Assert.assertEquals(AZURE_SHARED_ACCESS_TOKEN, azureAccountConfig.getSharedAccessStorageToken());
AzureStorage azureStorage = injector.getInstance(AzureStorage.class);
Assert.assertSame(cloudBlobClient.get(), azureStorage.getCloudBlobClient());
}
use of com.microsoft.azure.storage.blob.CloudBlobClient in project druid by druid-io.
the class AzureStorageDruidModuleTest method testGetAzureStorageContainerExpectedClient.
@Test
public void testGetAzureStorageContainerExpectedClient() {
injector = makeInjectorWithProperties(PROPERTIES);
Supplier<CloudBlobClient> cloudBlobClient = injector.getInstance(Key.get(new TypeLiteral<Supplier<CloudBlobClient>>() {
}));
StorageCredentials storageCredentials = cloudBlobClient.get().getCredentials();
Assert.assertEquals(AZURE_ACCOUNT_NAME, storageCredentials.getAccountName());
AzureStorage azureStorage = injector.getInstance(AzureStorage.class);
Assert.assertSame(cloudBlobClient.get(), azureStorage.getCloudBlobClient());
}
use of com.microsoft.azure.storage.blob.CloudBlobClient in project elasticsearch by elastic.
the class AzureStorageServiceTests method testGetSelectedClientDefault.
public void testGetSelectedClientDefault() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(settings);
CloudBlobClient client = azureStorageService.getSelectedClient(null, LocationMode.PRIMARY_ONLY);
assertThat(client.getEndpoint(), is(URI.create("https://azure1")));
}
use of com.microsoft.azure.storage.blob.CloudBlobClient in project elasticsearch by elastic.
the class AzureStorageServiceTests method testGetDefaultClientWithPrimaryAndSecondaries.
public void testGetDefaultClientWithPrimaryAndSecondaries() {
AzureStorageServiceImpl azureStorageService = new AzureStorageServiceMock(settings);
CloudBlobClient client = azureStorageService.getSelectedClient(null, LocationMode.PRIMARY_ONLY);
assertThat(client.getEndpoint(), is(URI.create("https://azure1")));
}
Aggregations