summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/test
diff options
context:
space:
mode:
authortangpeng <tang.peng5@zte.com.cn>2019-03-30 07:56:48 +0000
committertangpeng <tang.peng5@zte.com.cn>2019-03-30 07:56:48 +0000
commitcc31e5503fbc9c17ada9e3b324457c3a2d67ec54 (patch)
tree998325547d20eaf8aacb86c3f5b1443a63b9dc7e /rulemgt/src/test
parentdd6a7fa137605db8e2eec437167c438af0ea2447 (diff)
HTTP/S Modifications
Change-Id: I731a37f868a8145f3018314db7c0248a75c8d62d Issue-ID: HOLMES-203 Signed-off-by: tangpeng <tang.peng5@zte.com.cn>
Diffstat (limited to 'rulemgt/src/test')
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java5
-rw-r--r--rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java12
2 files changed, 7 insertions, 10 deletions
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
index 836b210..82e51a5 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java
@@ -19,7 +19,6 @@ package org.onap.holmes.rulemgt.bolt.enginebolt;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.any;
import static org.hamcrest.Matchers.equalTo;
import java.util.HashMap;
@@ -27,8 +26,6 @@ import org.apache.http.HttpResponse;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
-import org.easymock.EasyMock;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -78,7 +75,7 @@ public class EngineServiceTest {
public void testEngineService_closeHttpClient_ok() throws Exception {
PowerMock.resetAll();
CloseableHttpClient closeableHttpClient = HttpsUtils
- .getHttpClient(HttpsUtils.DEFUALT_TIMEOUT);
+ .getConditionalHttpsClient(HttpsUtils.DEFUALT_TIMEOUT);
Whitebox.invokeMethod(engineService, "closeHttpClient", closeableHttpClient);
}
diff --git a/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java b/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
index 4ad213c..53e60c8 100644
--- a/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
+++ b/rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java
@@ -79,20 +79,20 @@ public class DcaeConfigurationPollingTest {
CloseableHttpClient clientMock = createMock(CloseableHttpClient.class);
HttpResponse httpResponseMock = createMock(HttpResponse.class);
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.get(anyObject(HttpGet.class), anyObject(HashMap.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
expect(HttpsUtils.extractResponseEntity(httpResponseMock)).andReturn(JSONObject.toJSONString(ruleQueryListResponse));
clientMock.close();
expectLastCall();
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.delete(anyObject(HttpDelete.class), anyObject(HashMap.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
clientMock.close();
expectLastCall();
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.put(anyObject(HttpPut.class), anyObject(HashMap.class), anyObject(HashMap.class),
anyObject(StringEntity.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
@@ -132,13 +132,13 @@ public class DcaeConfigurationPollingTest {
CloseableHttpClient clientMock = createMock(CloseableHttpClient.class);
HttpResponse httpResponseMock = createMock(HttpResponse.class);
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.delete(anyObject(HttpDelete.class), anyObject(HashMap.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
clientMock.close();
expectLastCall();
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.put(anyObject(HttpPut.class), anyObject(HashMap.class), anyObject(HashMap.class),
anyObject(StringEntity.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
@@ -164,7 +164,7 @@ public class DcaeConfigurationPollingTest {
CloseableHttpClient clientMock = createMock(CloseableHttpClient.class);
HttpResponse httpResponseMock = createMock(HttpResponse.class);
- expect(HttpsUtils.getHttpClient(30000)).andReturn(clientMock);
+ expect(HttpsUtils.getConditionalHttpsClient(30000)).andReturn(clientMock);
expect(HttpsUtils.get(anyObject(HttpGet.class), anyObject(HashMap.class), anyObject(CloseableHttpClient.class)))
.andReturn(httpResponseMock);
expect(HttpsUtils.extractResponseEntity(httpResponseMock)).andReturn("{\"correlationRules\": [], \"totalCount\": 0}");