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 --- .../policy/builder/ControlLoopPolicyBuilder.java | 3 --- .../builder/impl/ControlLoopPolicyBuilderImpl.java | 3 +-- .../demo/clc/ControlLoopCoordinationTest.java | 26 +++++++++++++++----- .../demo/clc/ControlLoopEventCleanupTest.java | 24 +++++++++++++++---- .../policy/template/demo/CcvpnControlLoopTest.java | 13 +++++++--- .../template/demo/ControlLoopEventCleanupTest.java | 24 +++++++++++++++---- .../template/demo/ControlLoopFailureTest.java | 26 +++++++++++++++----- .../policy/template/demo/VcpeControlLoopTest.java | 26 +++++++++++++++----- .../policy/template/demo/VdnsControlLoopTest.java | 15 ++++++++---- .../policy/template/demo/VfcControlLoopTest.java | 15 ++++++++---- .../policy/template/demo/VfwControlLoopTest.java | 28 ++++++++++++++++------ .../policy/template/demo/VpciControlLoopTest.java | 26 +++++++++++++++----- 12 files changed, 172 insertions(+), 57 deletions(-) (limited to 'controlloop') diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java index 3c43756c3..533e19b72 100644 --- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java +++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java @@ -20,15 +20,12 @@ package org.onap.policy.controlloop.policy.builder; -import java.util.Map; - import org.onap.policy.aai.Pnf; import org.onap.policy.controlloop.policy.ControlLoop; import org.onap.policy.controlloop.policy.OperationsAccumulateParams; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyParam; import org.onap.policy.controlloop.policy.PolicyResult; -import org.onap.policy.controlloop.policy.Target; import org.onap.policy.controlloop.policy.builder.impl.ControlLoopPolicyBuilderImpl; import org.onap.policy.sdc.Resource; import org.onap.policy.sdc.Service; diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java index bd3939886..efc0f11d4 100644 --- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java +++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/builder/impl/ControlLoopPolicyBuilderImpl.java @@ -22,8 +22,8 @@ package org.onap.policy.controlloop.policy.builder.impl; import com.google.common.base.Strings; import java.util.LinkedList; -import java.util.Map; import java.util.UUID; + import org.onap.policy.aai.Pnf; import org.onap.policy.controlloop.compiler.CompilerException; import org.onap.policy.controlloop.compiler.ControlLoopCompiler; @@ -35,7 +35,6 @@ import org.onap.policy.controlloop.policy.OperationsAccumulateParams; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyParam; import org.onap.policy.controlloop.policy.PolicyResult; -import org.onap.policy.controlloop.policy.Target; import org.onap.policy.controlloop.policy.builder.BuilderException; import org.onap.policy.controlloop.policy.builder.ControlLoopPolicyBuilder; import org.onap.policy.controlloop.policy.builder.MessageLevel; 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(); diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java index ea9e85709..7469fdc75 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java @@ -49,6 +49,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; @@ -88,9 +89,15 @@ public class CcvpnControlLoopTest 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(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)); try { Util.buildAaiSim(); diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopEventCleanupTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopEventCleanupTest.java index 4ca89e1fb..0713a2800 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopEventCleanupTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/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; @@ -124,11 +125,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(); diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java index 344e888ac..112d4df93 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java @@ -54,6 +54,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; @@ -98,11 +99,24 @@ public class ControlLoopFailureTest 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(); Util.buildGuardSim(); @@ -363,7 +377,7 @@ public class ControlLoopFailureTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @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 entity to take an action on */ diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java index a27dbd026..c6d6dc082 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java @@ -55,6 +55,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; @@ -98,11 +99,24 @@ public class VcpeControlLoopTest 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(); Util.buildGuardSim(); @@ -359,7 +373,7 @@ public class VcpeControlLoopTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated */ protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) { diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java index 564b12a47..b5b7a4858 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java @@ -50,6 +50,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; @@ -92,9 +93,15 @@ public class VdnsControlLoopTest 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(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)); try { Util.buildAaiSim(); @@ -377,7 +384,7 @@ public class VdnsControlLoopTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated */ protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) { diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfcControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfcControlLoopTest.java index d03bac27f..5a5dc8ac4 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfcControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfcControlLoopTest.java @@ -52,6 +52,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; @@ -95,9 +96,15 @@ public class VfcControlLoopTest 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(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)); try { Util.buildAaiSim(); @@ -343,7 +350,7 @@ public class VfcControlLoopTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated */ protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) { diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfwControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfwControlLoopTest.java index adc9a2ac0..2bcaa5b7e 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfwControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfwControlLoopTest.java @@ -53,6 +53,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; @@ -96,11 +97,24 @@ public class VfwControlLoopTest 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-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(); @@ -398,7 +412,7 @@ public class VfwControlLoopTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated */ protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status) { @@ -418,7 +432,7 @@ public class VfwControlLoopTest implements TopicListener { * message) or end the control loop (abatement message). * * @param policy the controlLoopName comes from the policy - * @param requestID the requestId for this event + * @param requestId the requestId for this event * @param status could be onset or abated */ protected void sendEvent(ControlLoopPolicy policy, UUID requestId, ControlLoopEventStatus status, String vnfId) { diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VpciControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VpciControlLoopTest.java index 6d1086d87..89e309f09 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VpciControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VpciControlLoopTest.java @@ -52,6 +52,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; @@ -99,11 +100,24 @@ public class VpciControlLoopTest 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", "SDNR-CL", - "org.onap.policy.sdnr.PciRequestWrapper", 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("SDNR-CL") + .eventClass("org.onap.policy.sdnr.PciRequestWrapper") + .protocolFilter(new JsonProtocolFilter()) + .customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(1111)); try { Util.buildAaiSim(); Util.buildGuardSim(); @@ -377,7 +391,7 @@ public class VpciControlLoopTest implements TopicListener { * * @param policy * the controlLoopName comes from the policy - * @param requestID + * @param requestId * the requestId for this event * @param status * could be onset -- cgit 1.2.3-korg