diff options
author | a.sreekumar <ajith.sreekumar@est.tech> | 2020-01-21 17:05:36 +0000 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@est.tech> | 2020-01-23 13:33:34 +0000 |
commit | ed9690a42e5fd7007a91275a6ad208d1a7dafcaa (patch) | |
tree | 259be990cce4ed7f4abf8bde4816e06121dfe048 /main/src/test | |
parent | d3ddb3de43323a6af65b29777e79e68621d67227 (diff) |
Handling supported policy type during PdpGroup Update
Change-Id: I14daaa3d56d3293095227e0e3121e4fd82425b68
Issue-ID: POLICY-2023
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Diffstat (limited to 'main/src/test')
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java | 11 | ||||
-rw-r--r-- | main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java index 1ac97c77..ddf24293 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP PAP * ================================================================================ - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -479,10 +479,13 @@ public class TestPdpGroupCreateOrUpdateProvider extends ProviderSuper { newgrp.getPdpSubgroups().get(0).getSupportedPolicyTypes() .add(new ToscaPolicyTypeIdentifier("typeX.*", "9.8.7")); + // the group is updated with a new supported policy type in subgroup + assertEquals(2, newgrp.getPdpSubgroups().get(0).getSupportedPolicyTypes().size()); prov.createOrUpdateGroups(groups); - + // PdpGroup update doesn't allow supported policy type modifications + // during pdp group update, the ones in db is maintained + assertEquals(1, newgrp.getPdpSubgroups().get(0).getSupportedPolicyTypes().size()); assertEquals(newgrp.toString(), group.toString()); - assertGroupUpdateOnly(group); } @Test diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java index abec6d72..3f4015b1 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java @@ -26,7 +26,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; - import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; |