Source:
HttpPipeline getHttpPipeline(HttpClient httpClient, CryptographyServiceVersion serviceVersion) { TokenCredential credential = null; if (!interceptorManager.isPlaybackMode()) { String clientId = System.getenv("ARM_CLIENTID"); String clientKey = System.getenv("ARM_CLIENTKEY"); String tenantId = System.getenv("AZURE_TENANT_ID"); Objects.requireNonNull(clientId, "The client id cannot be null"); Objects.requireNonNull(clientKey, "The client key cannot be null"); Objects.requireNonNull(tenantId, "The tenant id cannot be null"); credential = new ClientSecretCredentialBuilder() .clientSecret(clientKey) .clientId(clientId) .tenantId(tenantId) .build(); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(SDK_NAME, SDK_VERSION, Configuration.getGlobalConfiguration().clone(), serviceVersion)); HttpPolicyProviders.addBeforeRetryPolicies(policies); RetryStrategy strategy = new ExponentialBackoff(5, Duration.ofSeconds(2), Duration.ofSeconds(16)); policies.add(new RetryPolicy(strategy)); if (credential != null) { policies.add(new BearerTokenAuthenticationPolicy(credential, CryptographyAsyncClient.KEY_VAULT_SCOPE)); } HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); if (!interceptorManager.isPlaybackMode()) { policies.add(interceptorManager.getRecordPolicy()); } return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient) .build(); }

Target:
HttpPipeline getHttpPipeline(HttpClient httpClient, CryptographyServiceVersion serviceVersion) { TokenCredential credential = null; if (!interceptorManager.isPlaybackMode()) { String clientId = System.getenv("ARM_CLIENTID"); String clientKey = System.getenv("ARM_CLIENTKEY"); String tenantId = System.getenv("AZURE_TENANT_ID"); Objects.requireNonNull(clientId, "The client id cannot be null"); Objects.requireNonNull(clientKey, "The client key cannot be null"); Objects.requireNonNull(tenantId, "The tenant id cannot be null"); credential = new ClientSecretCredentialBuilder() .clientSecret(clientKey) .clientId(clientId) .tenantId(tenantId) .build(); } final List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(SDK_NAME, SDK_VERSION, Configuration.getGlobalConfiguration().clone(), serviceVersion)); HttpPolicyProviders.addBeforeRetryPolicies(policies); RetryStrategy strategy = new ExponentialBackoff(5, Duration.ofSeconds(2), Duration.ofSeconds(16)); policies.add(new RetryPolicy(strategy)); if (credential != null) { policies.add(new BearerTokenAuthenticationPolicy(credential, CryptographyAsyncClient.KEY_VAULT_SCOPE)); } HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); if (getTestMode() == TestMode.RECORD) { policies.add(interceptorManager.getRecordPolicy()); } return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient) .build(); }