diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/instrument/resttemplate/PolarisCircuitBreakerHttpResponseTest.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/instrument/resttemplate/PolarisCircuitBreakerHttpResponseTest.java index da811692d..feebcb3a4 100644 --- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/instrument/resttemplate/PolarisCircuitBreakerHttpResponseTest.java +++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/test/java/com/tencent/cloud/polaris/circuitbreaker/instrument/resttemplate/PolarisCircuitBreakerHttpResponseTest.java @@ -17,6 +17,7 @@ package com.tencent.cloud.polaris.circuitbreaker.instrument.resttemplate; +import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; @@ -35,7 +36,7 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) public class PolarisCircuitBreakerHttpResponseTest { @Test - void testConstructorWithCodeOnly() { + void testConstructorWithCodeOnly() throws IOException { PolarisCircuitBreakerHttpResponse response = new PolarisCircuitBreakerHttpResponse(200); Assertions.assertEquals(200, response.getStatusCode().value()); @@ -45,7 +46,7 @@ public class PolarisCircuitBreakerHttpResponseTest { } @Test - void testConstructorWithCodeAndBody() { + void testConstructorWithCodeAndBody() throws IOException { String body = "test body"; PolarisCircuitBreakerHttpResponse response = new PolarisCircuitBreakerHttpResponse(200, body); @@ -56,7 +57,7 @@ public class PolarisCircuitBreakerHttpResponseTest { } @Test - void testConstructorWithCodeHeadersAndBody() { + void testConstructorWithCodeHeadersAndBody() throws IOException { String body = "test body"; Map headers = new HashMap<>(); headers.put("Content-Type", "application/json"); @@ -73,7 +74,7 @@ public class PolarisCircuitBreakerHttpResponseTest { } @Test - void testConstructorWithFallbackInfo() { + void testConstructorWithFallbackInfo() throws IOException { Map headers = new HashMap<>(); headers.put("Content-Type", "application/json"); CircuitBreakerStatus.FallbackInfo fallbackInfo = new CircuitBreakerStatus.FallbackInfo(200, headers, "test body");