@Test public void createClient_withProxy_shouldUseClientBuilderWithApacheConfigurator() throws Exception { setUpStubForCreateAuthenticator(); setUpObjectStorageClientBuilder(); when(mockStringAccessor.get(eq(BmcProperties.HTTP_PROXY_URI))) .thenReturn("http: when(mockStringAccessor.get(eq(BmcProperties.HTTP_PROXY_USERNAME))).thenReturn("username"); when(mockStringAccessor.get(eq(BmcProperties.HTTP_PROXY_PASSWORD))).thenReturn("password"); final ObjectStorage client = factoryUnderTest.createClient(mockPropAccessor); assertEquals("ObjectStorage should be equal", mockObjectStorageClient, client); verifyStatic(ObjectStorageClient.class); ObjectStorageClient.builder(); verify(mockObjectStorageClientBuilder).configuration(isA(ClientConfiguration.class)); final ArgumentCaptor<ClientConfigurator> configuratorCaptor = ArgumentCaptor.forClass(ClientConfigurator.class); verify(mockObjectStorageClientBuilder).clientConfigurator(configuratorCaptor.capture()); final ClientConfigurator actualClientConfigurator = configuratorCaptor.getValue(); assertTrue( "ClientConfigurator should be of type ApacheConfigurator", actualClientConfigurator instanceof ApacheConfigurator); verify(mockObjectStorageClientBuilder).build(isA(BasicAuthenticationDetailsProvider.class)); }
@VisibleForTesting ObjectStorage createClient(final BmcPropertyAccessor propertyAccessor) { final String customObjectStoreClient = propertyAccessor.asString().get(BmcProperties.OBJECT_STORE_CLIENT_CLASS); final ObjectStorage objectStorage = (customObjectStoreClient != null) ? (ObjectStorage) this.createClass(customObjectStoreClient) : buildClient(propertyAccessor); final String endpoint = propertyAccessor.asString().get(BmcProperties.HOST_NAME); LOG.info("Using endpoint {}", endpoint); objectStorage.setEndpoint(endpoint); return objectStorage; }
BmcDataStoreFactory { @VisibleForTesting ObjectStorage createClient(final BmcPropertyAccessor propertyAccessor) { final String customObjectStoreClient = propertyAccessor.asString().get(BmcProperties.OBJECT_STORE_CLIENT_CLASS); final ObjectStorage objectStorage = (customObjectStoreClient != null) ? (ObjectStorage) this.createClass(customObjectStoreClient) : buildClient(propertyAccessor); final String endpoint = propertyAccessor.asString().get(BmcProperties.HOST_NAME); LOG.info("Using endpoint {}", endpoint); objectStorage.setEndpoint(endpoint); return objectStorage; } }
BmcDataStoreFactory { @VisibleForTesting ObjectStorage createClient(final BmcPropertyAccessor propertyAccessor) { final String customObjectStoreClient = propertyAccessor.asString().get(BmcProperties.OBJECT_STORE_CLIENT_CLASS); final ObjectStorage objectStorage = (customObjectStoreClient != null) ? (ObjectStorage) this.createClass(customObjectStoreClient) : buildClient(propertyAccessor); final String endpoint = propertyAccessor.asString().get(BmcProperties.HOST_NAME); LOG.info("Using endpoint {}", endpoint); objectStorage.setEndpoint(endpoint); return objectStorage; }  }
BmcDataStoreFactory { @VisibleForTesting ObjectStorage createClient(final BmcPropertyAccessor propertyAccessor) { final String customObjectStoreClient = propertyAccessor.asString().get(BmcProperties.OBJECT_STORE_CLIENT_CLASS); final ObjectStorage objectStorage = (customObjectStoreClient != null) ? (ObjectStorage) this.createClass(customObjectStoreClient) : buildClient(propertyAccessor); final String endpoint = propertyAccessor.asString().get(BmcProperties.HOST_NAME); LOG.info("Using endpoint {}", endpoint); objectStorage.setEndpoint(endpoint); return objectStorage; }  BmcDataStore createDataStore(
            final String namespace, final String bucket, final Statistics statistics); }
BmcDataStoreFactory { @VisibleForTesting ObjectStorage createClient(final BmcPropertyAccessor propertyAccessor) { final String customObjectStoreClient = propertyAccessor.asString().get(BmcProperties.OBJECT_STORE_CLIENT_CLASS); final ObjectStorage objectStorage = (customObjectStoreClient != null) ? (ObjectStorage) this.createClass(customObjectStoreClient) : buildClient(propertyAccessor); final String endpoint = propertyAccessor.asString().get(BmcProperties.HOST_NAME); LOG.info("Using endpoint {}", endpoint); objectStorage.setEndpoint(endpoint); return objectStorage; }  BmcDataStore createDataStore(
            final String namespace, final String bucket, final Statistics statistics);  }