diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml
index 41e4303d4378c..a9dda36594109 100755
--- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml
+++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle.xml
@@ -60,7 +60,12 @@ page at http://checkstyle.sourceforge.net/config.html -->
-
+
+
+
+
+
+
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
index 26840826d978c..1d751432d7420 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
@@ -3,6 +3,7 @@
package com.azure.data.appconfiguration;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.annotation.ServiceClientBuilder;
import com.azure.core.util.logging.ClientLogger;
import com.azure.data.appconfiguration.credentials.ConfigurationClientCredentials;
@@ -165,7 +166,7 @@ public ConfigurationAsyncClient buildAsyncClient() {
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogDetailLevel));
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.httpClient(httpClient)
.build();
diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java
index b82ee17274582..95841f7199621 100644
--- a/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java
+++ b/sdk/appconfiguration/azure-data-appconfiguration/src/samples/java/com/azure/data/appconfiguration/ConfigurationClientJavaDocCodeSnippets.java
@@ -4,6 +4,7 @@
package com.azure.data.appconfiguration;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.rest.Response;
import com.azure.core.test.models.RecordedData;
import com.azure.core.test.policy.RecordNetworkCallPolicy;
@@ -34,7 +35,7 @@ public ConfigurationClient createAsyncConfigurationClientWithPipeline() {
String connectionString = getConnectionString();
// BEGIN: com.azure.data.applicationconfig.configurationclient.pipeline.instantiation
RecordedData networkData = new RecordedData();
- HttpPipeline pipeline = HttpPipeline.builder().policies(new RecordNetworkCallPolicy(networkData)).build();
+ HttpPipeline pipeline = new HttpPipelineBuilder().policies(new RecordNetworkCallPolicy(networkData)).build();
ConfigurationClient configurationClient = new ConfigurationClientBuilder()
.pipeline(pipeline)
diff --git a/sdk/core/azure-core-management/src/main/java/com/azure/core/management/implementation/AzureProxy.java b/sdk/core/azure-core-management/src/main/java/com/azure/core/management/implementation/AzureProxy.java
index a60817b69fdda..d892d00ce7189 100644
--- a/sdk/core/azure-core-management/src/main/java/com/azure/core/management/implementation/AzureProxy.java
+++ b/sdk/core/azure-core-management/src/main/java/com/azure/core/management/implementation/AzureProxy.java
@@ -8,6 +8,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -189,7 +190,7 @@ public static HttpPipeline createDefaultPipeline(Class> swaggerInterface, Http
policies.add(credentialsPolicy);
}
- return HttpPipeline.builder()
+ return new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
}
diff --git a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/AzureProxyToRestProxyTests.java b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/AzureProxyToRestProxyTests.java
index 8e6e63c015b66..c61f36a953b20 100644
--- a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/AzureProxyToRestProxyTests.java
+++ b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/AzureProxyToRestProxyTests.java
@@ -3,6 +3,7 @@
package com.azure.core.management;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.annotation.BodyParam;
import com.azure.core.implementation.annotation.Delete;
import com.azure.core.implementation.annotation.ExpectedResponses;
@@ -764,7 +765,7 @@ public void service18GetStatus500WithExpectedResponse500() {
}
private T createService(Class serviceClass) {
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(createHttpClient())
.build();
//
diff --git a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/AzureProxyTests.java b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/AzureProxyTests.java
index 7f1de50865f5a..05adb15d5994a 100644
--- a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/AzureProxyTests.java
+++ b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/AzureProxyTests.java
@@ -3,6 +3,7 @@
package com.azure.core.management.implementation;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.annotation.Delete;
import com.azure.core.implementation.annotation.ExpectedResponses;
import com.azure.core.implementation.annotation.Get;
@@ -851,7 +852,7 @@ public Mono send(HttpRequest request) {
}
private static T createMockService(Class serviceClass, MockAzureHttpClient httpClient) {
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(httpClient)
.build();
diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipeline.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipeline.java
index 7ee93824740a7..c0ae2db65d2e4 100644
--- a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipeline.java
+++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipeline.java
@@ -18,15 +18,6 @@ public final class HttpPipeline {
private final HttpPipelinePolicy[] pipelinePolicies;
- /**
- * Creates a builder that can configure options for the HttpPipeline before creating an instance of it.
- *
- * @return A new {@link HttpPipelineBuilder} to create a HttpPipeline from.
- */
- public static HttpPipelineBuilder builder() {
- return new HttpPipelineBuilder();
- }
-
/**
* Creates a HttpPipeline holding array of policies that gets applied to all request initiated through
* {@link HttpPipeline#send(HttpPipelineCallContext)} and it's response.
diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipelineBuilder.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipelineBuilder.java
index 14f7f6ab53e52..8642e8850b360 100644
--- a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipelineBuilder.java
+++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpPipelineBuilder.java
@@ -41,7 +41,12 @@ public class HttpPipelineBuilder {
private List pipelinePolicies;
- HttpPipelineBuilder() {
+ /**
+ - * Creates a builder that can configure options for the HttpPipeline before creating an instance of it.
+ - *
+ - * @return A new {@link HttpPipelineBuilder} to create a HttpPipeline from.
+ */
+ public HttpPipelineBuilder() {
}
/**
diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/RestProxy.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/RestProxy.java
index d61885ce272b3..107a3c410b24f 100644
--- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/RestProxy.java
+++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/RestProxy.java
@@ -11,6 +11,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.policy.CookiePolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -624,7 +625,7 @@ public static HttpPipeline createDefaultPipeline(HttpPipelinePolicy credentialsP
policies.add(credentialsPolicy);
}
- return HttpPipeline.builder()
+ return new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
}
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/UserAgentTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/UserAgentTests.java
index 404631e808c43..c97baf2b59ad7 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/UserAgentTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/UserAgentTests.java
@@ -6,6 +6,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.MockHttpClient;
import com.azure.core.http.MockHttpResponse;
@@ -19,7 +20,7 @@
public class UserAgentTests {
@Test
public void defaultUserAgentTests() throws Exception {
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
@Override
public Mono send(HttpRequest request) {
@@ -40,7 +41,7 @@ public Mono send(HttpRequest request) {
@Test
public void customUserAgentTests() throws Exception {
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
@Override
public Mono send(HttpRequest request) {
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/credentials/CredentialsTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/credentials/CredentialsTests.java
index 2362bf9d5b993..581042362bc4e 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/credentials/CredentialsTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/credentials/CredentialsTests.java
@@ -5,6 +5,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.MockHttpClient;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
@@ -28,7 +29,7 @@ public void basicCredentialsTest() throws Exception {
return next.process();
};
//
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies((context, next) -> credentials.getToken("scope./default")
.flatMap(token -> {
@@ -56,7 +57,7 @@ public Mono getToken(String... scopes) {
return next.process();
};
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies(new BearerTokenAuthenticationPolicy(credentials, "scope./default"), auditorPolicy)
.build();
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/HttpPipelineTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/HttpPipelineTests.java
index 07f2e164317e3..fc4d59e79685c 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/HttpPipelineTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/HttpPipelineTests.java
@@ -23,7 +23,7 @@
public class HttpPipelineTests {
@Test
public void constructorWithNoArguments() {
- HttpPipeline pipeline = HttpPipeline.builder().build();
+ HttpPipeline pipeline = new HttpPipelineBuilder().build();
assertEquals(0, pipeline.getPolicyCount());
assertNotNull(pipeline.httpClient());
assertTrue(pipeline.httpClient() instanceof ReactorNettyClient);
@@ -31,7 +31,7 @@ public void constructorWithNoArguments() {
@Test
public void withRequestPolicy() {
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.policies(new PortPolicy(80, true),
new ProtocolPolicy("ftp", true),
new RetryPolicy())
@@ -47,7 +47,7 @@ public void withRequestPolicy() {
@Test
public void withRequestOptions() throws MalformedURLException {
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.policies(new PortPolicy(80, true),
new ProtocolPolicy("ftp", true),
new RetryPolicy())
@@ -63,7 +63,7 @@ public void withRequestOptions() throws MalformedURLException {
public void withNoRequestPolicies() throws MalformedURLException {
final HttpMethod expectedHttpMethod = HttpMethod.GET;
final URL expectedUrl = new URL("http://my.site.com");
- final HttpPipeline httpPipeline = HttpPipeline.builder()
+ final HttpPipeline httpPipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
@Override
public Mono send(HttpRequest request) {
@@ -96,7 +96,7 @@ public Mono send(HttpRequest request) {
}
};
- final HttpPipeline httpPipeline = HttpPipeline.builder()
+ final HttpPipeline httpPipeline = new HttpPipelineBuilder()
.httpClient(httpClient)
.policies(new UserAgentPolicy(expectedUserAgent))
.build();
@@ -110,7 +110,7 @@ public Mono send(HttpRequest request) {
public void withRequestIdRequestPolicy() throws MalformedURLException {
final HttpMethod expectedHttpMethod = HttpMethod.GET;
final URL expectedUrl = new URL("http://my.site.com/1");
- final HttpPipeline httpPipeline = HttpPipeline.builder()
+ final HttpPipeline httpPipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
@Override
public Mono send(HttpRequest request) {
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/HostPolicyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/HostPolicyTests.java
index 8c209c4817c1f..beb4a130ad97a 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/HostPolicyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/HostPolicyTests.java
@@ -7,6 +7,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.ProxyOptions;
import org.junit.Test;
@@ -32,7 +33,7 @@ public void withPort() throws MalformedURLException {
}
private static HttpPipeline createPipeline(String host, String expectedUrl) {
- return HttpPipeline.builder()
+ return new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies(new HostPolicy(host),
(context, next) -> {
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProtocolPolicyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProtocolPolicyTests.java
index c581c598b71ae..3701b984d40d8 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProtocolPolicyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProtocolPolicyTests.java
@@ -7,6 +7,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.ProxyOptions;
import org.junit.Test;
@@ -32,7 +33,7 @@ public void withNoOverwrite() throws MalformedURLException {
pipeline.send(createHttpRequest("https://www.bing.com"));
}
private static HttpPipeline createPipeline(String protocol, String expectedUrl) {
- return HttpPipeline.builder()
+ return new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies(new ProtocolPolicy(protocol, true),
(context, next) -> {
@@ -43,7 +44,7 @@ private static HttpPipeline createPipeline(String protocol, String expectedUrl)
}
private static HttpPipeline createPipeline(String protocol, boolean overwrite, String expectedUrl) {
- return HttpPipeline.builder()
+ return new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies(new ProtocolPolicy(protocol, overwrite),
(context, next) -> {
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProxyAuthenticationPolicyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProxyAuthenticationPolicyTests.java
index 2832ab41e820f..7c0331086ae0f 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProxyAuthenticationPolicyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/ProxyAuthenticationPolicyTests.java
@@ -5,6 +5,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.MockHttpClient;
import org.junit.Test;
@@ -23,7 +24,7 @@ public void test() throws MalformedURLException {
final String username = "testuser";
final String password = "testpass";
//
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient())
.policies(new ProxyAuthenticationPolicy(username, password),
(context, next) -> {
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RequestIdPolicyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RequestIdPolicyTests.java
index e044f7d1ea5b6..035a0ded64c83 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RequestIdPolicyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RequestIdPolicyTests.java
@@ -7,6 +7,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.MockHttpClient;
import io.netty.buffer.ByteBuf;
@@ -62,7 +63,7 @@ public Mono bodyAsString(Charset charset) {
@Test
public void newRequestIdForEachCall() throws Exception {
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
String firstRequestId = null;
@Override
@@ -89,7 +90,7 @@ public Mono send(HttpRequest request) {
@Test
public void sameRequestIdForRetry() throws Exception {
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
String firstRequestId = null;
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RetryPolicyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RetryPolicyTests.java
index 7a20532fa07c0..03eb57f79fb6b 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RetryPolicyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/RetryPolicyTests.java
@@ -6,6 +6,7 @@
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpRequest;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.MockHttpClient;
import com.azure.core.http.MockHttpResponse;
@@ -20,7 +21,7 @@
public class RetryPolicyTests {
@Test
public void exponentialRetryEndOn501() throws Exception {
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
// Send 408, 500, 502, all retried, with a 501 ending
private final int[] codes = new int[]{408, 500, 502, 501};
@@ -43,7 +44,7 @@ public Mono send(HttpRequest request) {
@Test
public void exponentialRetryMax() throws Exception {
final int maxRetries = 5;
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockHttpClient() {
int count = -1;
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyStressTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyStressTests.java
index c5aea3ac2a0f6..a8a7258c419fa 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyStressTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyStressTests.java
@@ -14,7 +14,7 @@
import com.azure.core.implementation.annotation.PathParam;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.HttpHeaders;
-import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelineCallContext;
import com.azure.core.http.HttpPipelineNextPolicy;
import com.azure.core.http.HttpResponse;
@@ -108,7 +108,7 @@ public static void beforeClass() throws IOException {
polices.add(new HttpLoggingPolicy(HttpLogDetailLevel.BASIC, false));
//
service = RestProxy.create(IOService.class,
- HttpPipeline.builder()
+ new HttpPipelineBuilder()
.policies(polices.toArray(new HttpPipelinePolicy[0]))
.build());
@@ -506,7 +506,7 @@ public void testHighParallelism() {
}
final IOService innerService = RestProxy.create(IOService.class,
- HttpPipeline.builder()
+ new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build());
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyTests.java
index 2afd1cdd5768a..36137bf7e2051 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyTests.java
@@ -4,6 +4,7 @@
package com.azure.core.implementation;
import com.azure.core.MyRestException;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.annotation.BodyParam;
import com.azure.core.implementation.annotation.Delete;
import com.azure.core.implementation.annotation.ExpectedResponses;
@@ -1526,7 +1527,7 @@ public void flowableUploadTest() throws Exception {
//
// Order in which policies applied will be the order in which they added to builder
//
- final HttpPipeline httpPipeline = HttpPipeline.builder()
+ final HttpPipeline httpPipeline = new HttpPipelineBuilder()
.httpClient(httpClient)
.policies(new HttpLoggingPolicy(HttpLogDetailLevel.BODY_AND_HEADERS, true))
.build();
@@ -1611,14 +1612,14 @@ interface Service25 {
@Test(expected = HttpResponseException.class)
@Ignore("Decoding is not a policy anymore")
public void testMissingDecodingPolicyCausesException() {
- Service25 service = RestProxy.create(Service25.class, HttpPipeline.builder().build());
+ Service25 service = RestProxy.create(Service25.class, new HttpPipelineBuilder().build());
service.get();
}
@Test(expected = HttpResponseException.class)
@Ignore("Decoding is not a policy anymore")
public void testSingleMissingDecodingPolicyCausesException() {
- Service25 service = RestProxy.create(Service25.class, HttpPipeline.builder().build());
+ Service25 service = RestProxy.create(Service25.class, new HttpPipelineBuilder().build());
service.getAsync().block();
service.getBodyResponseAsync().block();
}
@@ -1626,7 +1627,7 @@ public void testSingleMissingDecodingPolicyCausesException() {
@Test(expected = HttpResponseException.class)
@Ignore("Decoding is not a policy anymore")
public void testSingleBodyResponseMissingDecodingPolicyCausesException() {
- Service25 service = RestProxy.create(Service25.class, HttpPipeline.builder().build());
+ Service25 service = RestProxy.create(Service25.class, new HttpPipelineBuilder().build());
service.getBodyResponseAsync().block();
}
@@ -1639,7 +1640,7 @@ interface Service26 {
@Test
public void postUrlFormEncoded() {
- Service26 service = RestProxy.create(Service26.class, HttpPipeline.builder().build());
+ Service26 service = RestProxy.create(Service26.class, new HttpPipelineBuilder().build());
HttpBinFormDataJSON response = service.postForm("Foo", "123", "foo@bar.com", PizzaSize.LARGE, Arrays.asList("Bacon", "Onion"));
assertNotNull(response);
assertNotNull(response.form());
@@ -1660,7 +1661,7 @@ protected T createService(Class serviceClass) {
}
protected T createService(Class serviceClass, HttpClient httpClient) {
- final HttpPipeline httpPipeline = HttpPipeline.builder()
+ final HttpPipeline httpPipeline = new HttpPipelineBuilder()
.httpClient(httpClient)
.build();
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyWithMockTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyWithMockTests.java
index ccbdace926087..32ae6b6789fb5 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyWithMockTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyWithMockTests.java
@@ -15,7 +15,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaders;
-import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.MockHttpClient;
@@ -179,7 +179,7 @@ interface ServiceErrorWithCharsetService {
public void serviceErrorWithResponseContentType() {
ServiceErrorWithCharsetService service = RestProxy.create(
ServiceErrorWithCharsetService.class,
- HttpPipeline.builder().httpClient(new SimpleMockHttpClient() {
+ new HttpPipelineBuilder().httpClient(new SimpleMockHttpClient() {
@Override
public Mono send(HttpRequest request) {
HttpHeaders headers = new HttpHeaders().put("Content-Type", "application/json");
@@ -202,7 +202,7 @@ public Mono send(HttpRequest request) {
public void serviceErrorWithResponseContentTypeBadJSON() {
ServiceErrorWithCharsetService service = RestProxy.create(
ServiceErrorWithCharsetService.class,
- HttpPipeline.builder().httpClient(new SimpleMockHttpClient() {
+ new HttpPipelineBuilder().httpClient(new SimpleMockHttpClient() {
@Override
public Mono send(HttpRequest request) {
HttpHeaders headers = new HttpHeaders().put("Content-Type", "application/json");
@@ -225,7 +225,7 @@ public Mono send(HttpRequest request) {
public void serviceErrorWithResponseContentTypeCharset() {
ServiceErrorWithCharsetService service = RestProxy.create(
ServiceErrorWithCharsetService.class,
- HttpPipeline.builder().httpClient(new SimpleMockHttpClient() {
+ new HttpPipelineBuilder().httpClient(new SimpleMockHttpClient() {
@Override
public Mono send(HttpRequest request) {
HttpHeaders headers = new HttpHeaders().put("Content-Type", "application/json; charset=UTF-8");
@@ -248,7 +248,7 @@ public Mono send(HttpRequest request) {
public void serviceErrorWithResponseContentTypeCharsetBadJSON() {
ServiceErrorWithCharsetService service = RestProxy.create(
ServiceErrorWithCharsetService.class,
- HttpPipeline.builder().httpClient(new SimpleMockHttpClient() {
+ new HttpPipelineBuilder().httpClient(new SimpleMockHttpClient() {
@Override
public Mono send(HttpRequest request) {
HttpHeaders headers = new HttpHeaders().put("Content-Type", "application/json; charset=UTF-8");
diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyXMLTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyXMLTests.java
index 7ea7c05e50ed7..b533a6ff9103f 100644
--- a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyXMLTests.java
+++ b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/RestProxyXMLTests.java
@@ -16,6 +16,7 @@
import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpMethod;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.HttpResponse;
import com.azure.core.http.MockHttpResponse;
@@ -96,7 +97,7 @@ interface MyXMLService {
@Test
public void canReadXMLResponse() throws Exception {
//
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockXMLHTTPClient())
.build();
@@ -162,7 +163,7 @@ public void canWriteXMLRequest() throws Exception {
JacksonAdapter serializer = new JacksonAdapter();
MockXMLReceiverClient httpClient = new MockXMLReceiverClient();
//
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(httpClient)
.build();
//
@@ -199,7 +200,7 @@ public interface MyXMLServiceWithAttributes {
public void canDeserializeXMLWithAttributes() throws Exception {
JacksonAdapter serializer = new JacksonAdapter();
//
- final HttpPipeline pipeline = HttpPipeline.builder()
+ final HttpPipeline pipeline = new HttpPipelineBuilder()
.httpClient(new MockXMLHTTPClient())
.build();
diff --git a/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java b/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java
index 63cf4e554a5f8..f344fe5262688 100644
--- a/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java
+++ b/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyClientBuilder.java
@@ -3,6 +3,7 @@
package com.azure.security.keyvault.keys;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.util.ImplUtils;
import com.azure.core.util.configuration.Configuration;
import com.azure.core.credentials.TokenCredential;
@@ -126,7 +127,7 @@ public KeyAsyncClient buildAsyncClient() {
policies.addAll(this.policies);
policies.add(new HttpLoggingPolicy(httpLogDetailLevel));
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.httpClient(httpClient)
.build();
diff --git a/sdk/keyvault/azure-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java
index 6f63be8f59b68..4860b4e71d4b6 100644
--- a/sdk/keyvault/azure-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyClientJavaDocCodeSnippets.java
@@ -6,6 +6,7 @@
import com.azure.core.credentials.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.test.models.RecordedData;
import com.azure.core.test.policy.RecordNetworkCallPolicy;
@@ -72,7 +73,7 @@ public KeyAsyncClient createAsyncClient() {
public KeyAsyncClient createAsyncClientWithPipeline() {
// BEGIN: com.azure.security.keyvault.keys.async.keyclient.pipeline.instantiation
RecordedData networkData = new RecordedData();
- HttpPipeline pipeline = HttpPipeline.builder().policies(new RecordNetworkCallPolicy(networkData)).build();
+ HttpPipeline pipeline = new HttpPipelineBuilder().policies(new RecordNetworkCallPolicy(networkData)).build();
KeyAsyncClient keyClient = new KeyClientBuilder()
.pipeline(pipeline)
.endpoint("https://myvault.azure.net/")
diff --git a/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretClientBuilder.java b/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretClientBuilder.java
index 5d51121fb007c..2cbd05b7b2607 100644
--- a/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretClientBuilder.java
+++ b/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretClientBuilder.java
@@ -3,6 +3,7 @@
package com.azure.security.keyvault.secrets;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.implementation.annotation.ServiceClientBuilder;
import com.azure.core.util.configuration.ConfigurationManager;
import com.azure.core.util.configuration.Configuration;
@@ -126,7 +127,7 @@ public SecretAsyncClient buildAsyncClient() {
policies.addAll(this.policies);
policies.add(new HttpLoggingPolicy(httpLogDetailLevel));
- HttpPipeline pipeline = HttpPipeline.builder()
+ HttpPipeline pipeline = new HttpPipelineBuilder()
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.httpClient(httpClient)
.build();
diff --git a/sdk/keyvault/azure-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java
index 3b71f4e882ccc..7b92e5986b42e 100644
--- a/sdk/keyvault/azure-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java
+++ b/sdk/keyvault/azure-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java
@@ -5,6 +5,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.test.models.RecordedData;
import com.azure.core.test.policy.RecordNetworkCallPolicy;
@@ -24,7 +25,7 @@ public final class SecretClientJavaDocCodeSnippets {
public SecretAsyncClient createAsyncClientWithHttpclient() {
// BEGIN: com.azure.security.keyvault.keys.async.secretclient.withhttpclient.instantiation
RecordedData networkData = new RecordedData();
- HttpPipeline pipeline = HttpPipeline.builder().policies(new RecordNetworkCallPolicy(networkData)).build();
+ HttpPipeline pipeline = new HttpPipelineBuilder().policies(new RecordNetworkCallPolicy(networkData)).build();
SecretAsyncClient keyClient = new SecretClientBuilder()
.httpLogDetailLevel(HttpLogDetailLevel.BODY_AND_HEADERS)
.endpoint("https://myvault.azure.net/")
@@ -89,7 +90,7 @@ private SecretClient getSyncSecretClient() {
public SecretAsyncClient createAsyncClientWithPipeline() {
// BEGIN: com.azure.security.keyvault.keys.async.secretclient.pipeline.instantiation
RecordedData networkData = new RecordedData();
- HttpPipeline pipeline = HttpPipeline.builder().policies(new RecordNetworkCallPolicy(networkData)).build();
+ HttpPipeline pipeline = new HttpPipelineBuilder().policies(new RecordNetworkCallPolicy(networkData)).build();
SecretAsyncClient keyClient = new SecretClientBuilder()
.pipeline(pipeline)
.endpoint("https://myvault.azure.net/")
diff --git a/storage/client/blob/src/test/java/com/azure/storage/blob/APISpec.groovy b/storage/client/blob/src/test/java/com/azure/storage/blob/APISpec.groovy
index fb306c17ff358..8e431ff054fd2 100644
--- a/storage/client/blob/src/test/java/com/azure/storage/blob/APISpec.groovy
+++ b/storage/client/blob/src/test/java/com/azure/storage/blob/APISpec.groovy
@@ -3,9 +3,15 @@
package com.azure.storage.blob
-import com.azure.core.http.*
+import com.azure.core.http.HttpClient
+import com.azure.core.http.HttpHeaders
+import com.azure.core.http.HttpPipelineCallContext
+import com.azure.core.http.HttpPipelineNextPolicy
+import com.azure.core.http.HttpRequest
+import com.azure.core.http.HttpResponse
import com.azure.core.http.policy.HttpLogDetailLevel
import com.azure.core.http.policy.HttpPipelinePolicy
+import com.azure.core.http.ProxyOptions
import com.azure.core.http.rest.Response
import com.azure.core.util.configuration.ConfigurationManager
import com.azure.identity.credential.EnvironmentCredential