From 6a55a271c6ca735ceaf4ab306633cb30715561bd Mon Sep 17 00:00:00 2001 From: "kris.jinka" Date: Fri, 16 Nov 2018 10:26:19 +0900 Subject: Remove unused imports in controlpolicy Remove unused imports that got introduced in recent commits Fix issue with compile failure of test class due to dependency in drools-pdp Datamodel classes. Fix test failures due to compile issues Issue-ID: POLICY-1251 Change-Id: Ib8e496ab96aaa5de67e4f84fa8de515b3dc22ea5 Signed-off-by: kris.jinka --- .../demo/clc/ControlLoopCoordinationTest.java | 26 +++++++++++++++++----- .../demo/clc/ControlLoopEventCleanupTest.java | 24 +++++++++++++++----- 2 files changed, 39 insertions(+), 11 deletions(-) (limited to 'controlloop/templates/template.demo.clc/src') diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java index 1d8779999..588d00563 100644 --- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java +++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java @@ -60,6 +60,7 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.VirtualControlLoopNotification; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; +import org.onap.policy.drools.protocol.coders.EventProtocolParams; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; @@ -104,11 +105,24 @@ public class ControlLoopCoordinationTest implements TopicListener { "org.onap.policy.controlloop.util.Serialization,gsonPretty"); noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties); - EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT", - "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, null, - 1111); - EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-LCM-READ", - "org.onap.policy.appclcm.LcmRequestWrapper", new JsonProtocolFilter(), null, null, 1111); + EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder() + .groupId("junit.groupId") + .artifactId("junit.artifactId") + .topic("POLICY-CL-MGT") + .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification") + .protocolFilter(new JsonProtocolFilter()) + .customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(1111)); + EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder() + .groupId("junit.groupId") + .artifactId("junit.artifactId") + .topic("APPC-LCM-READ") + .eventClass("org.onap.policy.appclcm.LcmRequestWrapper") + .protocolFilter(new JsonProtocolFilter()) + .customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(1111)); try { Util.buildAaiSim(); } catch (Exception e) { @@ -172,7 +186,7 @@ public class ControlLoopCoordinationTest implements TopicListener { * control loop (abatement message). * * @param controlLoopName the control loop name - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated * @param target the target name * @param kieSession the kieSession to which this event is being sent diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java index da9b2a85b..ef5fac693 100644 --- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java +++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java @@ -47,6 +47,7 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent; import org.onap.policy.controlloop.eventmanager.ControlLoopEventManager; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; +import org.onap.policy.drools.protocol.coders.EventProtocolParams; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; @@ -123,11 +124,24 @@ public class ControlLoopEventCleanupTest { "org.onap.policy.controlloop.util.Serialization,gsonPretty"); final List noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties); - EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "POLICY-CL-MGT", - "org.onap.policy.controlloop.VirtualControlLoopNotification", new JsonProtocolFilter(), null, - null, 1111); - EventProtocolCoder.manager.addEncoder("junit.groupId", "junit.artifactId", "APPC-CL", - "org.onap.policy.appc.Request", new JsonProtocolFilter(), null, null, 1111); + EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder() + .groupId("junit.groupId") + .artifactId("junit.artifactId") + .topic("POLICY-CL-MGT") + .eventClass("org.onap.policy.controlloop.VirtualControlLoopNotification") + .protocolFilter(new JsonProtocolFilter()) + .customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(1111)); + EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder() + .groupId("junit.groupId") + .artifactId("junit.artifactId") + .topic("APPC-CL") + .eventClass("org.onap.policy.appc.Request") + .protocolFilter(new JsonProtocolFilter()) + .customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(1111)); try { Util.buildAaiSim(); -- cgit 1.2.3-korg