From ed9690a42e5fd7007a91275a6ad208d1a7dafcaa Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Tue, 21 Jan 2020 17:05:36 +0000 Subject: Handling supported policy type during PdpGroup Update Change-Id: I14daaa3d56d3293095227e0e3121e4fd82425b68 Issue-ID: POLICY-2023 Signed-off-by: a.sreekumar --- .../pap/main/rest/TestPdpGroupCreateOrUpdateProvider.java | 11 +++++++---- .../java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'main/src/test/java') 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; -- cgit 1.2.3-korg