diff options
author | kris.jinka <kris.jinka@samsung.com> | 2018-11-15 09:51:02 +0900 |
---|---|---|
committer | kris.jinka <kris.jinka@samsung.com> | 2018-11-15 09:51:21 +0900 |
commit | 96b3a0059c5900f33d8c1b4f4295f6d84177e2bf (patch) | |
tree | 3a9983cb9b542a30d4eb00c7e8e8bb06a71b9023 /policy-management/src/test/java/org/onap | |
parent | f14baf16a435eaa1ed8714741996ed01775572f8 (diff) |
Modify event (en)coder to use param objs
Use builder object to send params to event protocol
coder and encoder methods to fix sonar issue
Issue-ID: POLICY-1251
Change-Id: I6ca5823e1aa35d9aa3a05eb23ac159947efdde23
Signed-off-by: kris.jinka <kris.jinka@samsung.com>
Diffstat (limited to 'policy-management/src/test/java/org/onap')
2 files changed, 13 insertions, 8 deletions
diff --git a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java index d6330cd5..ec1b9994 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/protocol/coders/EventProtocolCoderTest.java @@ -84,9 +84,12 @@ public class EventProtocolCoderTest { TopicEndpoint.manager.addTopicSinks(noopSinkProperties); - EventProtocolCoder.manager.addEncoder(ENCODER_GROUP, ENCODER_ARTIFACT, NOOP_TOPIC, - DroolsConfiguration.class.getCanonicalName(), new JsonProtocolFilter(), null, null, - DroolsConfiguration.class.getName().hashCode()); + EventProtocolCoder.manager.addEncoder( + EventProtocolParams.builder().groupId(ENCODER_GROUP).artifactId(ENCODER_ARTIFACT) + .topic(NOOP_TOPIC).eventClass(DroolsConfiguration.class.getCanonicalName()) + .protocolFilter(new JsonProtocolFilter()).customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(DroolsConfiguration.class.getName().hashCode())); final String json = EventProtocolCoder.manager.encode(NOOP_TOPIC, new DroolsConfiguration(ENCODER_GROUP, ENCODER_ARTIFACT, ENCODER_VERSION)); diff --git a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineTest.java b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineTest.java index cd93d94c..4a2767a8 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineTest.java +++ b/policy-management/src/test/java/org/onap/policy/drools/system/PolicyEngineTest.java @@ -41,10 +41,9 @@ import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; import org.onap.policy.drools.persistence.SystemPersistence; import org.onap.policy.drools.properties.DroolsProperties; 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.protocol.configuration.DroolsConfiguration; -import org.onap.policy.drools.system.PolicyController; -import org.onap.policy.drools.system.PolicyEngine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -205,9 +204,12 @@ public class PolicyEngineTest { TopicEndpoint.manager.addTopicSinks(noopSinkProperties).get(0).start(); - EventProtocolCoder.manager.addEncoder(ENCODER_GROUP, ENCODER_ARTIFACT, NOOP_TOPIC, - DroolsConfiguration.class.getCanonicalName(), new JsonProtocolFilter(), null, null, - DroolsConfiguration.class.getName().hashCode()); + EventProtocolCoder.manager.addEncoder( + EventProtocolParams.builder().groupId(ENCODER_GROUP).artifactId(ENCODER_ARTIFACT) + .topic(NOOP_TOPIC).eventClass(DroolsConfiguration.class.getCanonicalName()) + .protocolFilter(new JsonProtocolFilter()).customGsonCoder(null) + .customJacksonCoder(null) + .modelClassLoaderHash(DroolsConfiguration.class.getName().hashCode())); assertTrue(PolicyEngine.manager.deliver(NOOP_TOPIC, new DroolsConfiguration(ENCODER_GROUP, ENCODER_ARTIFACT, ENCODER_VERSION))); |