aboutsummaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-08 10:21:36 -0400
committerJim Hahn <jrh3@att.com>2019-07-08 15:51:01 -0400
commita593d0931f9a5785572bb52c5dfae32faa5d8116 (patch)
tree5b8aac486241678b83afd744868e1bb01d7670a2 /feature-lifecycle/src/test
parentf1d4f751519980c7683538b3530f9c3661093c6c (diff)
Fix drools-pdp due to sonar changes in common
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I26a38340707b2903e089350c31c5dfdb5c019ee0 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-lifecycle/src/test')
-rw-r--r--feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
index 3cf5c596..92269167 100644
--- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
+++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java
@@ -29,7 +29,9 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
+import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.models.pdp.enums.PdpState;
@@ -44,12 +46,12 @@ public class RestLifecycleManagerTest {
*/
@Before
public void setUp() throws Exception {
- HttpServletServer.factory.destroy();
- HttpClient.factory.destroy();
+ HttpServletServerFactoryInstance.getServerFactory().destroy();
+ HttpClientFactoryInstance.getClientFactory().destroy();
SystemPersistence.manager.setConfigurationDir("target/test-classes");
- HttpClient.factory.build(
+ HttpClientFactoryInstance.getClientFactory().build(
BusTopicParams.builder()
.clientName("lifecycle")
.hostname("localhost")
@@ -59,7 +61,7 @@ public class RestLifecycleManagerTest {
.build());
HttpServletServer server =
- HttpServletServer.factory.build("lifecycle", "localhost", 8765, "/", true, true);
+ HttpServletServerFactoryInstance.getServerFactory().build("lifecycle", "localhost", 8765, "/", true, true);
server.addServletClass("/*", RestLifecycleManager.class.getName());
server.setSerializationProvider("org.onap.policy.common.gson.JacksonHandler");
server.waitedStart(5000L);
@@ -73,17 +75,17 @@ public class RestLifecycleManagerTest {
*/
@After
public void tearDown() {
- HttpServletServer.factory.destroy();
- HttpClient.factory.destroy();
+ HttpServletServerFactoryInstance.getServerFactory().destroy();
+ HttpClientFactoryInstance.getClientFactory().destroy();
}
@Test
public void fsm() {
- Response response = HttpClient.factory.get("lifecycle").get("fsm");
+ Response response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm");
assertNotNull(HttpClient.getBody(response, String.class));
assertEquals(Status.OK.getStatusCode(), response.getStatus());
- response = HttpClient.factory.get("lifecycle").get("fsm/state");
+ response = HttpClientFactoryInstance.getClientFactory().get("lifecycle").get("fsm/state");
assertEquals(PdpState.TERMINATED, HttpClient.getBody(response, PdpState.class));
assertEquals(Status.OK.getStatusCode(), response.getStatus());
}