diff options
author | Jim Hahn <jrh3@att.com> | 2019-11-22 14:57:22 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-11-22 14:57:22 -0500 |
commit | b65a0d069b8559e8bc5f1448944df5d1a0823805 (patch) | |
tree | 4854e30c3087322d654ac6e9cae12ad5001ea870 /main/src/test/java/org | |
parent | 855fade6ec6e31a80681c692ddfdc21c97e97b08 (diff) |
Update Pdp Group state per PAP API
The PAP API can be used to update the state of a Pdp Group. However,
the state wasn't being updated - fixed.
Issue-ID: POLICY-2269
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I67fa3409424cfdb4b53b17e86f4cf354732d87e8
Diffstat (limited to 'main/src/test/java/org')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java index 899b5695..60f9d2e8 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java @@ -233,6 +233,22 @@ public class TestPdpGroupDeployProvider extends ProviderSuper { } @Test + public void testUpdateGroup_NewState() throws Exception { + PdpGroups groups = loadPdpGroups("createGroups.json"); + PdpGroup newgrp = groups.getGroups().get(0); + PdpGroup group = new PdpGroup(newgrp); + group.setPdpGroupState(PdpState.TEST); + when(dao.getPdpGroups(group.getName())).thenReturn(Arrays.asList(group)); + + prov.createOrUpdateGroups(groups); + + assertGroupUpdateOnly(group); + + assertEquals(PdpState.ACTIVE, group.getPdpGroupState()); + assertEquals(newgrp.toString(), group.toString()); + } + + @Test public void testUpdateGroup_NewSubGroup() throws Exception { PdpGroups groups = loadPdpGroups("createGroupsNewSub.json"); PdpGroup group = loadPdpGroups("createGroups.json").getGroups().get(0); |