diff options
Diffstat (limited to 'src/test/java/org/onap')
-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); + } } |