summaryrefslogtreecommitdiffstats
path: root/artifactbroker/reception
diff options
context:
space:
mode:
Diffstat (limited to 'artifactbroker/reception')
-rw-r--r--artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java3
-rw-r--r--artifactbroker/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyArtifactForwarder.java11
2 files changed, 4 insertions, 10 deletions
diff --git a/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java b/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
index 7081dc7..c00bfa1 100644
--- a/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
+++ b/artifactbroker/reception/src/main/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandler.java
@@ -74,11 +74,10 @@ public abstract class AbstractReceptionHandler implements ReceptionHandler {
*/
protected void inputReceived(final PolicyInput policyInput) throws PolicyDecodingException {
- final Collection<IArtifactInfo> policies = new ArrayList<>();
for (final ArtifactForwarder policyForwarder : pluginHandler.getArtifactForwarders()) {
try {
- policyForwarder.forward(policies);
+ policyForwarder.forward(policyInput);
} catch (final ArtifactForwardingException policyForwardingException) {
LOGGER.error("Error when forwarding policies to " + policyForwarder, policyForwardingException);
}
diff --git a/artifactbroker/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyArtifactForwarder.java b/artifactbroker/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyArtifactForwarder.java
index 5785927..ee3d166 100644
--- a/artifactbroker/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyArtifactForwarder.java
+++ b/artifactbroker/reception/src/test/java/org/onap/policy/distribution/reception/handling/DummyArtifactForwarder.java
@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.Collection;
import org.onap.policy.distribution.forwarding.ArtifactForwarder;
import org.onap.policy.distribution.forwarding.ArtifactForwardingException;
-import org.onap.sdc.api.notification.IArtifactInfo;
+import org.onap.policy.distribution.model.PolicyInput;
/**
* Class to create a dummy forwarder for test cases in AbstractReceptionHandlerTest.
@@ -33,21 +33,16 @@ import org.onap.sdc.api.notification.IArtifactInfo;
*/
public class DummyArtifactForwarder implements ArtifactForwarder {
private int numberOfPoliciesReceived = 0;
- private Collection<IArtifactInfo> policiesReceived = new ArrayList<>();
@Override
- public void forward(final Collection<IArtifactInfo> policies) throws ArtifactForwardingException {
- numberOfPoliciesReceived += policies.size();
- policiesReceived.addAll(policies);
+ public void forward(final PolicyInput policy) throws ArtifactForwardingException {
+ numberOfPoliciesReceived += 1;
}
public int getNumberOfPoliciesReceived() {
return numberOfPoliciesReceived;
}
- public boolean receivedPolicy(final IArtifactInfo policy) {
- return policiesReceived.contains(policy);
- }
@Override
public void configure(String parameterGroupName) {}