diff options
author | mmis <michael.morris@ericsson.com> | 2018-08-27 23:29:24 +0100 |
---|---|---|
committer | mmis <michael.morris@ericsson.com> | 2018-08-30 16:52:30 +0100 |
commit | de6124af19910e5ebb1de6698843b8ab64b5931a (patch) | |
tree | 0a7ecfa5c8199e01108345bbd8957db46441b59d /reception/src/test/java/org/onap | |
parent | e705197bb18af558fb7ea853b01e1297521763f2 (diff) |
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 <michael.morris@ericsson.com>
Diffstat (limited to 'reception/src/test/java/org/onap')
2 files changed, 25 insertions, 3 deletions
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<String, PolicyForwarderParameters> policyForwarders = new HashMap<String, PolicyForwarderParameters>(); 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) {} } |