From de6124af19910e5ebb1de6698843b8ab64b5931a Mon Sep 17 00:00:00 2001 From: mmis Date: Mon, 27 Aug 2018 23:29:24 +0100 Subject: Create code infrastructure for policy forwarding Added sending of polices from the policy forwarder to the xacml PDP and added handling of parameters for configuring the policy forwarders Issue-ID: POLICY-926 Change-Id: I26effe70769f7edc765470a1a9ad40ed9faad82d Signed-off-by: mmis --- .../handling/AbstractReceptionHandlerTest.java | 24 ++++++++++++++++++++-- .../reception/handling/DummyPolicyForwarder.java | 4 +++- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'reception/src/test/java') diff --git a/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java b/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java index 83fe5a45..d339507c 100644 --- a/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java +++ b/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java @@ -29,7 +29,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; - import org.junit.Test; import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.distribution.forwarding.PolicyForwarder; @@ -57,6 +56,7 @@ public class AbstractReceptionHandlerTest { private static final String FORWARDER_TYPE = "DummyForwarder"; private static final String FORWARDER_CLASS_NAME = "org.onap.policy.distribution.reception.handling.DummyPolicyForwarder"; + private static final String FORWARDER_CONFIGURATION_PARAMETERS = "DummyConfiguration"; @Test public void testInputReceived() throws PolicyDecodingException, NoSuchFieldException, SecurityException, @@ -121,9 +121,29 @@ public class AbstractReceptionHandlerTest { } class DummyPolicy1 implements Policy { + + @Override + public String getPolicyName() { + return null; + } + + @Override + public String getPolicyType() { + return null; + } } class DummyPolicy2 implements Policy { + + @Override + public String getPolicyName() { + return null; + } + + @Override + public String getPolicyType() { + return null; + } } private void setUpPlugins(final AbstractReceptionHandler receptionHandler, @@ -160,7 +180,7 @@ public class AbstractReceptionHandlerTest { final Map policyForwarders = new HashMap(); final PolicyForwarderParameters pFParameters = - new PolicyForwarderParameters(FORWARDER_TYPE, FORWARDER_CLASS_NAME); + new PolicyForwarderParameters(FORWARDER_TYPE, FORWARDER_CLASS_NAME, FORWARDER_CONFIGURATION_PARAMETERS); policyForwarders.put(FORWARDER_KEY, pFParameters); return policyForwarders; } diff --git a/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyPolicyForwarder.java b/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyPolicyForwarder.java index acee4697..a665c546 100644 --- a/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyPolicyForwarder.java +++ b/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyPolicyForwarder.java @@ -22,7 +22,6 @@ package org.onap.policy.distribution.reception.handling; import java.util.ArrayList; import java.util.Collection; - import org.onap.policy.distribution.forwarding.PolicyForwarder; import org.onap.policy.distribution.forwarding.PolicyForwardingException; import org.onap.policy.distribution.model.Policy; @@ -49,4 +48,7 @@ public class DummyPolicyForwarder implements PolicyForwarder { public boolean receivedPolicy(final Policy policy) { return policiesReceived.contains(policy); } + + @Override + public void configure(String parameterGroupName) {} } -- cgit 1.2.3-korg