diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2019-04-02 01:14:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-02 01:14:03 +0000 |
commit | 6e783fe6e2b456486af69bd334aa167409b29fd7 (patch) | |
tree | de6c9d232956ed3306af3562c97aa782dd98d3a6 /rulemgt/src/test/java | |
parent | 4af1314bf34bc531ce6266a2aacfee91dd00c773 (diff) | |
parent | cc31e5503fbc9c17ada9e3b324457c3a2d67ec54 (diff) |
Merge "HTTP/S Modifications"
Diffstat (limited to 'rulemgt/src/test/java')
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineServiceTest.java | 5 | ||||
-rw-r--r-- | rulemgt/src/test/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPollingTest.java | 12 |
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}"); |