From a6c229cc5539e9fdac45c625952d5e34957bbff8 Mon Sep 17 00:00:00 2001 From: Anu Thomas Chandy Date: Mon, 8 Feb 2021 20:43:30 -0800 Subject: [PATCH] Remove unused throws from unit tests. --- .../android/core/http/policy/ProtocolPolicyTests.java | 5 ++--- .../android/core/http/policy/RequestIdPolicyTests.java | 4 ++-- .../azure/android/core/http/policy/RetryPolicyTests.java | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/ProtocolPolicyTests.java b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/ProtocolPolicyTests.java index 8ab79d9c4..47a87a328 100644 --- a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/ProtocolPolicyTests.java +++ b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/ProtocolPolicyTests.java @@ -15,7 +15,6 @@ import com.azure.android.core.test.http.NoOpHttpClient; import org.junit.jupiter.api.Test; -import java.net.MalformedURLException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -25,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; public class ProtocolPolicyTests { @Test - public void withOverwrite() throws MalformedURLException { + public void withOverwrite() { final HttpPipeline pipeline = createPipeline("ftp", "ftp://www.bing.com"); CountDownLatch latch = new CountDownLatch(1); pipeline.send(createHttpRequest("http://www.bing.com"), @@ -50,7 +49,7 @@ public class ProtocolPolicyTests { } @Test - public void withNoOverwrite() throws MalformedURLException { + public void withNoOverwrite() { final HttpPipeline pipeline = createPipeline("ftp", false, "https://www.bing.com"); CountDownLatch latch = new CountDownLatch(1); pipeline.send(createHttpRequest("https://www.bing.com"), diff --git a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RequestIdPolicyTests.java b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RequestIdPolicyTests.java index a2eab8e92..efcfa16ea 100644 --- a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RequestIdPolicyTests.java +++ b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RequestIdPolicyTests.java @@ -68,7 +68,7 @@ public class RequestIdPolicyTests { private static final String REQUEST_ID_HEADER = "x-ms-client-request-id"; @Test - public void newRequestIdForEachCall() throws Exception { + public void newRequestIdForEachCall() { HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(new NoOpHttpClient() { String firstRequestId = null; @@ -130,7 +130,7 @@ public class RequestIdPolicyTests { } @Test - public void sameRequestIdForRetry() throws Exception { + public void sameRequestIdForRetry() { final HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(new NoOpHttpClient() { String firstRequestId = null; diff --git a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RetryPolicyTests.java b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RetryPolicyTests.java index 2980e7c1e..228586e06 100644 --- a/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RetryPolicyTests.java +++ b/sdk/core/azure-core-http/src/test/java/com/azure/android/core/http/policy/RetryPolicyTests.java @@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; public class RetryPolicyTests { @Test - public void retryEndOn501() throws Exception { + public void retryEndOn501() { final HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(new NoOpHttpClient() { // Send 408, 500, 502, all retried, with a 501 ending @@ -79,7 +79,7 @@ public class RetryPolicyTests { } @Test - public void retryMax() throws Exception { + public void retryMax() { final int maxRetries = 5; final HttpPipeline pipeline = new HttpPipelineBuilder() .httpClient(new NoOpHttpClient() { @@ -120,7 +120,7 @@ public class RetryPolicyTests { } @Test - public void fixedDelayRetry() throws Exception { + public void fixedDelayRetry() { final int maxRetries = 5; final long delayMillis = 500; final HttpPipeline pipeline = new HttpPipelineBuilder() @@ -158,7 +158,7 @@ public class RetryPolicyTests { } @Test - public void exponentialDelayRetry() throws Exception { + public void exponentialDelayRetry() { final int maxRetries = 5; final long baseDelayMillis = 100; final long maxDelayMillis = 1000;