diff options
author | Liam Fallon <liam.fallon@est.tech> | 2021-02-23 15:00:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-23 15:00:22 +0000 |
commit | 19f16ce2d6c58e5b603dc99c760820341563bebe (patch) | |
tree | 1c91c6f8004e0d92120b1f93f5816d49b3c286f6 /src/test/java | |
parent | 9359ac6c0f60cacc0a5820fdf33a17f596322e79 (diff) | |
parent | 44a539f0b8ac56494ce2100aab798f268526a127 (diff) |
Merge "Introduce a new endpoint to create policy" into tosca-poc
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/policy/clamp/policy/pdpgroup/PoliciesPdpMergerTest.java | 12 |
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); + } } |