summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@est.tech>2019-07-17 11:03:26 +0000
committerramverma <ram.krishna.verma@est.tech>2019-07-17 11:03:26 +0000
commitcf748512392e5d3257de629dc57fb353dc073c92 (patch)
tree8e81a773d1f9556669b344d5f31dd139999ef2f6 /main
parent5f032e0363703239f30dff29914dc41dd3abca48 (diff)
Changing policy/distribution to use policy/models
1) Changed policy distribution framework to use entities from policy/models 2) Changed all the test cases. 3) Commented few test cases which will be fixed along with code fixes. 4) Will be removing the old policy entities once all the pieces are ready. Change-Id: I1fd7b975b2e072c0b24e429903c9ca4796173929 Issue-ID: POLICY-1888 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Diffstat (limited to 'main')
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java10
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java11
2 files changed, 11 insertions, 10 deletions
diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java
index d210d970..b9ee0768 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyDecoder.java
@@ -22,27 +22,27 @@ package org.onap.policy.distribution.main.testclasses;
import java.util.Collection;
-import org.onap.policy.distribution.model.Policy;
import org.onap.policy.distribution.model.PolicyInput;
import org.onap.policy.distribution.reception.decoding.PolicyDecoder;
import org.onap.policy.distribution.reception.decoding.PolicyDecodingException;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
/**
* Class to create a dummy decoder for test cases.
*
* @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
*/
-public class DummyDecoder implements PolicyDecoder<PolicyInput, Policy> {
+public class DummyDecoder implements PolicyDecoder<PolicyInput, ToscaEntity> {
private boolean canHandleValue;
- private Collection<Policy> policesToReturn;
+ private Collection<ToscaEntity> policesToReturn;
public DummyDecoder() {
this.canHandleValue = false;
this.policesToReturn = null;
}
- public DummyDecoder(final boolean canHandleValue, final Collection<Policy> policesToReturn) {
+ public DummyDecoder(final boolean canHandleValue, final Collection<ToscaEntity> policesToReturn) {
this.canHandleValue = canHandleValue;
this.policesToReturn = policesToReturn;
}
@@ -53,7 +53,7 @@ public class DummyDecoder implements PolicyDecoder<PolicyInput, Policy> {
}
@Override
- public Collection<Policy> decode(final PolicyInput input) throws PolicyDecodingException {
+ public Collection<ToscaEntity> decode(final PolicyInput input) throws PolicyDecodingException {
return policesToReturn;
}
diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java
index c9c7fef2..f2779c85 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyPolicyForwarder.java
@@ -22,9 +22,10 @@ package org.onap.policy.distribution.main.testclasses;
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;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
/**
* Class to create a dummy forwarder for test cases.
@@ -33,10 +34,10 @@ import org.onap.policy.distribution.model.Policy;
*/
public class DummyPolicyForwarder implements PolicyForwarder {
private int numberOfPoliciesReceived = 0;
- private Collection<Policy> policiesReceived = new ArrayList<>();
+ private Collection<ToscaEntity> policiesReceived = new ArrayList<>();
@Override
- public void forward(final Collection<Policy> policies) throws PolicyForwardingException {
+ public void forward(final Collection<ToscaEntity> policies) throws PolicyForwardingException {
numberOfPoliciesReceived += policies.size();
policiesReceived.addAll(policies);
}
@@ -45,10 +46,10 @@ public class DummyPolicyForwarder implements PolicyForwarder {
return numberOfPoliciesReceived;
}
- public boolean receivedPolicy(final Policy policy) {
+ public boolean receivedPolicy(final ToscaEntity policy) {
return policiesReceived.contains(policy);
}
@Override
- public void configure(String parameterGroupName) {}
+ public void configure(final String parameterGroupName) {}
}