aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2021-02-16 14:53:43 +0100
committerLiam Fallon <liam.fallon@est.tech>2021-02-23 09:51:46 +0000
commit44a539f0b8ac56494ce2100aab798f268526a127 (patch)
tree0c7d974d9872d42c541a4149b676f78cd7df8779 /src/test/java/org
parent09ace211a47e77a922911126ca2ba144500c4cfe (diff)
Introduce a new endpoint to create policy
One first part of the update is to create a policy version from an existing one (this is similar as the create new policy). The policy-flow.xml has been refactored so that the same policy query is done for policies and loop related flows. A code has been added to remove fields from the UI that could be present (the PDP group info json enrichment) Issue-ID: POLICY-2926 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: Ia60c656a9b5100296042d3346d5c97c8dad5d041 (cherry picked from commit a0a3a03686a386bf6def6f7da6de4d3f6a11ce61)
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java
index 21157eb71..adb797897 100644
--- a/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java
+++ b/src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java
@@ -25,6 +25,7 @@ package org.onap.policy.clamp.policy.pdpgroup;
import static org.assertj.core.api.Assertions.assertThat;
+import com.google.gson.JsonObject;
import java.io.IOException;
import java.util.Arrays;
import org.junit.BeforeClass;
@@ -99,4 +100,15 @@ public class PoliciesPdpMergerTest {
ResourceFileUtils.getResourceAsString("http-cache/example/policy/api/v1/policies/.file"),
pdpGroupsJson).toString(), true);
}
+
+ @Test
+ public void testRemovePdpStatesOnePolicy() throws IOException {
+ JsonObject policiesList = PoliciesPdpMerger.removePdpStatesOnePolicy(JsonUtils.GSON
+ .fromJson(ResourceFileUtils.getResourceAsString("example/policy/single-policy-enriched.json"),
+ JsonObject.class));
+
+ assertThat(policiesList.get(PdpGroupsAnalyzer.ASSIGNED_PDP_GROUPS_INFO)).isNull();
+ assertThat(policiesList.get(PdpGroupsAnalyzer.SUPPORTED_PDP_GROUPS_INFO)).isNull();
+ assertThat(policiesList.size()).isEqualTo(6);
+ }
}