aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2021-02-10 12:00:04 +0000
committerwaynedunican <wayne.dunican@est.tech>2021-02-22 20:52:37 +0000
commitef2a2a1c93a78377e9bffe47d4d974d15bad4810 (patch)
treef7657b279fd9c95ba8f958650ff63340a279797d /main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java
parent80a4d78e798bee6379961008c2d49b7fae5f2924 (diff)
Support Policy updates between PAP and PDPs
Change to send only the policies that need to be updated (deployed/undeployed) rather than full of policies to DMaap via the PDP_UPDATE message Issue-ID: POLICY-2112 Change-Id: I65f8bf46f230afb9d4b6937cb89af1d9f05d2fbd Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java
index 6b76c258..ad249164 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestSessionData.java
@@ -577,15 +577,19 @@ public class TestSessionData extends ProviderSuper {
ToscaConceptIdentifier policyId = new ToscaConceptIdentifier(POLICY_NAME, POLICY_VERSION);
List<String> pdps = Arrays.asList(PDP1, PDP2);
+ ToscaPolicy testPolicy = session.getPolicy(new ToscaConceptIdentifierOptVersion(policyId));
+
if (deploy) {
- session.trackDeploy(policyId, pdps, GROUP_NAME, PDP_TYPE);
+ session.trackDeploy(testPolicy, pdps, GROUP_NAME, PDP_TYPE);
+ assertThat(session.getPoliciesToBeDeployed()).contains(testPolicy);
} else {
session.trackUndeploy(policyId, pdps, GROUP_NAME, PDP_TYPE);
+ assertThat(session.getPoliciesToBeUndeployed()).contains(policyId);
}
// should be called just once
verify(status).deleteDeployment(any(), anyBoolean());
- verify(status).deleteDeployment(policyId, !deploy);
+ verify(status, times(1)).deleteDeployment(policyId, !deploy);
// should be called for each PDP
verify(status, times(2)).deploy(any(), any(), any(), any(), any(), anyBoolean());