diff options
author | jrh3 <jrh3@att.com> | 2019-06-20 14:57:50 -0400 |
---|---|---|
committer | jrh3 <jrh3@att.com> | 2019-06-20 16:12:30 -0400 |
commit | b346fda03f450ccf9f8adb143f872cfce6ba76a8 (patch) | |
tree | 5dc6167e8a8bf143dd92d24682e587fd47ef5f2d /main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java | |
parent | 82cc7e0ccf799e0ea5d9afd033a3cff88468b6bf (diff) |
Allow integer version when using PDP Group Deploy
The policies listed in a "PDP Group Deploy" request may not have
fully qualified versions. Modified the code to replace the versions
in the request with fully qualified versions.
Also improved performance by avoiding look-ups of policies that
are already in the subgroup.
Change-Id: I37899c2b45228b97a80b7ef44f69694ba57e8f4a
Issue-ID: POLICY-1784
Signed-off-by: jrh3 <jrh3@att.com>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java index 180c0320..d7d9b677 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java @@ -189,6 +189,20 @@ public class TestSessionData extends ProviderSuper { } @Test + public void testIsVersionPrefix() { + assertTrue(SessionData.isVersionPrefix("1")); + assertTrue(SessionData.isVersionPrefix("12")); + assertTrue(SessionData.isVersionPrefix("1.2")); + assertTrue(SessionData.isVersionPrefix("1.23")); + + assertFalse(SessionData.isVersionPrefix("1.")); + assertFalse(SessionData.isVersionPrefix("1.2.")); + assertFalse(SessionData.isVersionPrefix("1.2.3")); + assertFalse(SessionData.isVersionPrefix("1.2.3.")); + assertFalse(SessionData.isVersionPrefix("1.2.3.4")); + } + + @Test public void testAddRequests_testGetPdpStateChanges_testGetPdpUpdates() { // pre-load with a update and state-change for other PDPs PdpUpdate update2 = makeUpdate(PDP2); |