summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-management/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/feature-controlloop-management/src/test')
-rw-r--r--controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java28
-rw-r--r--controlloop/common/feature-controlloop-management/src/test/resources/op.pom9
2 files changed, 18 insertions, 19 deletions
diff --git a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java
index 3d89e5a1e..849b4189b 100644
--- a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java
+++ b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java
@@ -38,7 +38,7 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.kie.api.builder.ReleaseId;
-import org.onap.policy.common.endpoints.http.client.HttpClient;
+import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.drools.persistence.SystemPersistence;
import org.onap.policy.drools.properties.DroolsProperties;
@@ -100,7 +100,7 @@ public class RestControlLoopManagerTest {
PolicyEngine.manager.createPolicyController(CONTROLLER, controllerProperties);
PolicyEngine.manager.start();
- HttpClient.factory.build(SystemPersistence.manager.getProperties(CLIENT_CONFIG));
+ HttpClientFactoryInstance.getClientFactory().build(SystemPersistence.manager.getProperties(CLIENT_CONFIG));
if (!NetworkUtil.isTcpPortOpen("localhost", 9696, 6, 10000L)) {
throw new IllegalStateException("cannot connect to port 9696");
@@ -143,30 +143,30 @@ public class RestControlLoopManagerTest {
*/
@Test
public void testOperationalPolicy() throws IOException {
- assertEquals(Status.OK.getStatusCode(),
- HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOPS).getStatus());
+ assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+ .get(URL_CONTEXT_PATH_CONTROLLOOPS).getStatus());
- assertEquals(Status.OK.getStatusCode(),
- HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP).getStatus());
+ assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+ .get(URL_CONTEXT_PATH_CONTROLLOOP).getStatus());
- assertEquals(Status.NOT_FOUND.getStatusCode(),
- HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
+ assertEquals(Status.NOT_FOUND.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+ .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
String policyFromFile = new String(Files.readAllBytes(Paths.get(POLICY)));
- HttpClient.factory.get(CONTROLLER)
- .put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY, Entity.text(policyFromFile), Collections.emptyMap());
+ HttpClientFactoryInstance.getClientFactory().get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
+ Entity.text(policyFromFile), Collections.emptyMap());
- assertEquals(Status.OK.getStatusCode(),
- HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
+ assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+ .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
- String policyFromPdpD = HttpClient.factory.get(CONTROLLER)
+ String policyFromPdpD = HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
.get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY)
.readEntity(String.class);
assertEquals(policyFromFile, policyFromPdpD);
assertEquals(Status.CONFLICT.getStatusCode(),
- HttpClient.factory.get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
+ HttpClientFactoryInstance.getClientFactory().get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
Entity.text(policyFromFile), Collections.emptyMap()).getStatus());
}
diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/op.pom b/controlloop/common/feature-controlloop-management/src/test/resources/op.pom
index 91b651cbb..517410d66 100644
--- a/controlloop/common/feature-controlloop-management/src/test/resources/op.pom
+++ b/controlloop/common/feature-controlloop-management/src/test/resources/op.pom
@@ -3,7 +3,7 @@
============LICENSE_START=======================================================
ONAP
================================================================================
- Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2019 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,14 +26,13 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>model-impl</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
+ <artifactId>common</artifactId>
+ <version>1.5.1-SNAPSHOT</version>
</parent>
<groupId>org.onap.policy.drools.apps.test</groupId>
<artifactId>op</artifactId>
- <version>1.5.0-SNAPSHOT</version>
<dependencies>
<dependency>