From b1105dd8f4fa2cf21cc4eb4a6f825685a185173b Mon Sep 17 00:00:00 2001 From: GuangrongFu Date: Thu, 8 Mar 2018 18:14:50 +0800 Subject: [PATCH] Change the Exception from Generic to Specific Change-Id: I6d84339a95953e09171eef883f0b3c2fbeb71d96 Issue-ID: HOLMES-118 Signed-off-by: GuangrongFu --- .../src/main/java/org/onap/holmes/common/utils/HttpsUtils.java | 2 +- .../java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java index 41db955..a2c4852 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java @@ -200,7 +200,7 @@ public class HttpsUtils { } private static HttpResponse executeRequest(CloseableHttpClient httpClient, HttpRequestBase httpRequest) - throws Exception { + throws CorrelationException, IOException { HttpResponse httpResponse; try { httpResponse = httpClient.execute(httpRequest); diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java index 8eefd4e..76aad81 100644 --- a/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java +++ b/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java @@ -16,24 +16,17 @@ package org.onap.holmes.common.utils; -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import javax.ws.rs.QueryParam; - import org.easymock.EasyMock; import org.junit.Rule; import org.junit.Test; -import org.junit.runner.RunWith; -import org.onap.holmes.common.exception.CorrelationException; -import org.onap.holmes.common.msb.MicroserviceBusRest; -import org.onap.holmes.common.api.entity.ServiceRegisterEntity; import org.onap.holmes.common.config.MicroServiceConfig; +import org.onap.holmes.common.exception.CorrelationException; import org.onap.msb.sdk.discovery.entity.MicroServiceFullInfo; import org.onap.msb.sdk.discovery.entity.MicroServiceInfo; import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.modules.junit4.rule.PowerMockRule; @PrepareForTest({MicroServiceConfig.class, MSBServiceClient.class, MSBRegisterUtil.class}) -- 2.16.6