diff options
Diffstat (limited to 'rulemgt/src/test')
-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}"); |