Remove legacy operational policy from drools-apps 99/111299/2
authorJim Hahn <jrh3@att.com>
Fri, 14 Aug 2020 23:29:51 +0000 (19:29 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 14 Aug 2020 23:31:48 +0000 (19:31 -0400)
Issue-ID: POLICY-2766
Change-Id: I1ff7bbc4e301cfe6fa746f38c839acf83f7584b6
Signed-off-by: Jim Hahn <jrh3@att.com>
controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java
controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/DroolsRuleTest.java
controlloop/common/rules-test/src/main/resources/vcpe/tosca-legacy-vcpe.json [deleted file]
controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json [deleted file]
controlloop/common/rules-test/src/main/resources/vfw/tosca-vfw.json [deleted file]
controlloop/common/rules-test/src/main/resources/vpci/tosca-vpci.json [deleted file]
controlloop/common/rules-test/src/main/resources/vsonh/tosca-vsonh.json [deleted file]
controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/BaseTestTest.java
controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/DroolsRuleTestTest.java

index 7250576..76048f5 100644 (file)
@@ -77,7 +77,6 @@ public abstract class BaseTest {
     private static final String DUPLICATES_APPC_SUCCESS = "duplicates/duplicates.appc.success.json";
 
     // VCPE
-    private static final String VCPE_TOSCA_LEGACY_POLICY = "vcpe/tosca-legacy-vcpe.json";
     private static final String VCPE_TOSCA_COMPLIANT_POLICY = "vcpe/tosca-compliant-vcpe.json";
     private static final String VCPE_ONSET_1 = "vcpe/vcpe.onset.1.json";
     private static final String VCPE_ONSET_2 = "vcpe/vcpe.onset.2.json";
@@ -85,13 +84,11 @@ public abstract class BaseTest {
     private static final String VCPE_APPC_SUCCESS = "vcpe/vcpe.appc.success.json";
 
     // VDNS
-    private static final String VDNS_TOSCA_LEGACY_POLICY = "vdns/tosca-legacy-vdns.json";
     private static final String VDNS_TOSCA_COMPLIANT_POLICY = "vdns/tosca-compliant-vdns.json";
     private static final String VDNS_TOSCA_COMPLIANT_RAINY_POLICY = "vdns/tosca-compliant-vdns-rainy.json";
     private static final String VDNS_ONSET = "vdns/vdns.onset.json";
 
     // VFW
-    private static final String VFW_TOSCA_LEGACY_POLICY = "vfw/tosca-vfw.json";
     private static final String VFW_TOSCA_COMPLIANT_POLICY = "vfw/tosca-compliant-vfw.json";
     private static final String VFW_TOSCA_COMPLIANT_TIME_OUT_POLICY = "vfw/tosca-compliant-timeout-vfw.json";
     private static final String VFW_ONSET = "vfw/vfw.onset.json";
@@ -99,13 +96,11 @@ public abstract class BaseTest {
     private static final String VFW_APPC_FAILURE = "vfw/vfw.appc.failure.json";
 
     // VPCI
-    private static final String VPCI_TOSCA_POLICY = "vpci/tosca-vpci.json";
     private static final String VPCI_TOSCA_COMPLIANT_POLICY = "vpci/tosca-compliant-vpci.json";
     private static final String VPCI_ONSET = "vpci/vpci.onset.json";
     private static final String VPCI_SDNR_SUCCESS = "vpci/vpci.sdnr.success.json";
 
     // VSONH
-    private static final String VSONH_TOSCA_POLICY = "vsonh/tosca-vsonh.json";
     private static final String VSONH_TOSCA_COMPLIANT_POLICY = "vsonh/tosca-compliant-vsonh.json";
     private static final String VSONH_ONSET = "vsonh/vsonh.onset.json";
     private static final String VSONH_SDNR_SUCCESS = "vsonh/vsonh.sdnr.success.json";
@@ -268,14 +263,6 @@ public abstract class BaseTest {
 
     // VCPE
 
-    /**
-     * Sunny Day with Legacy Tosca Policy.
-     */
-    @Test
-    public void testVcpeSunnyDayLegacy() {
-        appcLcmSunnyDay(VCPE_TOSCA_LEGACY_POLICY, VCPE_ONSET_1, APPC_RESTART_OP);
-    }
-
     /**
      * Sunny Day with Tosca Compliant Policy.
      */
@@ -297,14 +284,6 @@ public abstract class BaseTest {
 
     // VDNS
 
-    /**
-     * Sunny Day with Legacy Tosca Policy.
-     */
-    @Test
-    public void testVdnsSunnyDayLegacy() {
-        httpSunnyDay(VDNS_TOSCA_LEGACY_POLICY, VDNS_ONSET);
-    }
-
     /**
      * Sunny Day with Tosca Compliant Policy.
      */
@@ -324,14 +303,6 @@ public abstract class BaseTest {
 
     // VFW
 
-    /**
-     * VFW Sunny Day with Legacy Tosca Policy.
-     */
-    @Test
-    public void testVfwSunnyDayLegacy() {
-        appcLegacySunnyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP);
-    }
-
     /**
      * VFW Sunny Day with Tosca Compliant Policy.
      */
@@ -340,14 +311,6 @@ public abstract class BaseTest {
         appcLegacySunnyDay(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP);
     }
 
-    /**
-     * VFW Rainy Day using legacy tosca policy (operation and final failure).
-     */
-    @Test
-    public void testVfwRainyDayLegacyFailure() {
-        appcLegacyRainyDay(VFW_TOSCA_LEGACY_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP);
-    }
-
     /**
      * VFW Rainy Day using compliant tosca policy (final failure).
      */
@@ -364,14 +327,6 @@ public abstract class BaseTest {
         appcLegacyRainyDayNoResponse(VFW_TOSCA_COMPLIANT_POLICY, VFW_ONSET, APPC_MODIFY_CONFIG_OP);
     }
 
-    /**
-     * VPCI Sunny Day with Legacy Tosca Policy.
-     */
-    @Test
-    public void testVpciSunnyDayLegacy() {
-        sdnrSunnyDay(VPCI_TOSCA_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, "ModifyConfig");
-    }
-
     /**
      * VPCI Sunny Day Tosca Policy.
      */
@@ -382,14 +337,6 @@ public abstract class BaseTest {
 
     // VSONH
 
-    /**
-     * VSONH Sunny Day with Legacy Tosca Policy.
-     */
-    @Test
-    public void testVsonhSunnyDayLegacy() {
-        sdnrSunnyDay(VSONH_TOSCA_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, "ModifyConfigANR");
-    }
-
     /**
      * VSONH Sunny Day with Tosca Policy.
      */
index a57395c..580b398 100644 (file)
@@ -21,7 +21,6 @@
 package org.onap.policy.controlloop.common.rules.test;
 
 import java.util.function.Function;
-import org.onap.policy.controlloop.ControlLoopNotificationType;
 import org.onap.policy.controlloop.VirtualControlLoopNotification;
 import org.onap.policy.drools.system.PolicyController;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
diff --git a/controlloop/common/rules-test/src/main/resources/vcpe/tosca-legacy-vcpe.json b/controlloop/common/rules-test/src/main/resources/vcpe/tosca-legacy-vcpe.json
deleted file mode 100644 (file)
index cb0806e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "type": "onap.policies.controlloop.Operational",
-  "type_version": "1.0.0",
-  "properties": {
-    "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0A%20%20trigger_policy%3A%20unique-policy-id-1-restart%0A%20%20timeout%3A%203600%0A%20%20abatement%3A%20false%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-restart%0A%20%20%20%20name%3A%20Restart%20the%20VM%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20APPC%0A%20%20%20%20recipe%3A%20Restart%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VM%0A%20%20%20%20retry%3A%203%0A%20%20%20%20timeout%3A%201200%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
-  },
-  "name": "vcpe",
-  "version": "1.0.0"
-}
diff --git a/controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json b/controlloop/common/rules-test/src/main/resources/vdns/tosca-legacy-vdns.json
deleted file mode 100644 (file)
index e43ae09..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "type": "onap.policies.controlloop.Operational",
-  "type_version": "1.0.0",
-  "properties": {
-    "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20services%3A%0A%20%20%20%20-%20serviceName%3A%20d4738992-6497-4dca-9db9%0A%20%20%20%20%20%20serviceInvariantUUID%3A%20dc112d6e-7e73-4777-9c6f-1a7fb5fd1b6f%0A%20%20%20%20%20%20serviceUUID%3A%202eea06c6-e1d3-4c3a-b9c4-478c506eeedf%0A%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20timeout%3A%2060%0A%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SO%0A%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VFMODULE%0A%20%20%20%20%20%20modelInvariantId%3A%20e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e%0A%20%20%20%20%20%20modelVersionId%3A%2094b18b1d-cc91-4f43-911a-e6348665f292%0A%20%20%20%20%20%20modelName%3A%20VfwclVfwsnkBbefb8ce2bde..base_vfw..module-0%0A%20%20%20%20%20%20modelVersion%3A%201%0A%20%20%20%20%20%20modelCustomizationId%3A%2047958575-138f-452a-8c8d-d89b595f8164%0A%20%20%20%20payload%3A%0A%20%20%20%20%20%20requestParameters%3A%20%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A%20%20%20%20%20%20configurationParameters%3A%20%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%2030%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard%0A"
-  },
-  "name": "vdns",
-  "version": "1.0.0"
-}
diff --git a/controlloop/common/rules-test/src/main/resources/vfw/tosca-vfw.json b/controlloop/common/rules-test/src/main/resources/vfw/tosca-vfw.json
deleted file mode 100644 (file)
index b9f6b7f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-  "type": "onap.policies.controlloop.Operational",
-  "type_version": "1.0.0",
-  "properties": {
-    "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0A%20%20services%3A%0A%20%20%20%20-%20serviceInvariantUUID%3A%20f6937c86-584c-47ae-ad29-8d41d6f0cc7c%0A%20%20%20%20%20%20serviceUUID%3A%207be584e2-0bb2-4126-adaf-ced2c77ca0b3%0A%20%20%20%20%20%20serviceName%3A%20Service_Ete_Name7ba1fbde-6187-464a-a62d-d9dd25bdf4e8%0A%20%20trigger_policy%3A%20unique-policy-id-1-modifyConfig%0A%20%20timeout%3A%2060%0A%20%20abatement%3A%20false%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-modifyConfig%0A%20%20%20%20name%3A%20modify%20packet%20gen%20config%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20APPC%0A%20%20%20%20recipe%3A%20ModifyConfig%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20resourceID%3A%20bbb3cefd-01c8-413c-9bdd-2b92f9ca3d38%0A%20%20%20%20%20%20type%3A%20VNF%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%207%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
-  },
-  "name": "vfw",
-  "version": "1.0.0"
-}
diff --git a/controlloop/common/rules-test/src/main/resources/vpci/tosca-vpci.json b/controlloop/common/rules-test/src/main/resources/vpci/tosca-vpci.json
deleted file mode 100644 (file)
index 84b047e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "type": "onap.policies.controlloop.Operational",
-    "type_version": "1.0.0",
-    "properties": {
-        "policy-id": "operational.pcihandler",
-        "content": "controlLoop%3A%0A%20%20version%3A%203.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459%0A%20%20trigger_policy%3A%20unique-policy-id-123-modifyconfig%0A%20%20timeout%3A%201200%0A%20%20abatement%3A%20false%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-123-modifyconfig%0A%20%20%20%20name%3A%20modify%20PCI%20config%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SDNR%0A%20%20%20%20recipe%3A%20ModifyConfig%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20%23%20These%20fields%20are%20not%20used%0A%20%20%20%20%20%20resourceID%3A%20Eace933104d443b496b8.nodes.heat.vpg%0A%20%20%20%20%20%20type%3A%20PNF%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%207000%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
-    },
-    "name": "vpci",
-    "version": "1.0.0"
-
-}
diff --git a/controlloop/common/rules-test/src/main/resources/vsonh/tosca-vsonh.json b/controlloop/common/rules-test/src/main/resources/vsonh/tosca-vsonh.json
deleted file mode 100644 (file)
index 4927bee..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "type": "onap.policies.controlloop.Operational",
-    "type_version": "1.0.0",
-    "properties": {
-        "policy-id": "operational.sonhandler",
-        "content": "controlLoop%3A%0A%20%20version%3A%204.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vSONH-7d4baf04-8875-4d1f-946d-06b874048b61%0A%20%20trigger_policy%3A%20unique-policy-id-456-modifyconfig%0A%20%20timeout%3A%201200%0A%20%20abatement%3A%20false%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-456-modifyconfig%0A%20%20%20%20name%3A%20modify%20ANR%20config%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SDNR%0A%20%20%20%20recipe%3A%20ModifyConfigANR%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20%23%20These%20fields%20are%20not%20used%0A%20%20%20%20%20%20resourceID%3A%20Eace933104d443b496b8.nodes.heat.vpg%0A%20%20%20%20%20%20type%3A%20PNF%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%20300%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
-    },
-    "name": "sonh",
-    "version": "1.0.0"
-}
index ecff7e0..ea90a6b 100644 (file)
@@ -136,8 +136,8 @@ public class BaseTestTest {
                         any(StandardCoder.class))).thenReturn(appcLcmRead);
         when(topics.createListener(eq(BaseTest.APPC_CL_TOPIC), eq(Request.class),
                         any(StandardCoderInstantAsMillis.class))).thenReturn(appcClSink);
-        when(topics.createListener(eq(BaseTest.SDNR_CL_TOPIC), eq(PciMessage.class),
-            any(StandardCoder.class))).thenReturn(sdnrClSink);
+        when(topics.createListener(eq(BaseTest.SDNR_CL_TOPIC), eq(PciMessage.class), any(StandardCoder.class)))
+                        .thenReturn(sdnrClSink);
 
         Supplier<HttpClients> httpClientMaker = this::makeHttpClients;
         Supplier<Simulators> simMaker = this::makeSim;
@@ -204,7 +204,7 @@ public class BaseTestTest {
 
     @Test
     public void testInit() {
-        assertSame(topics, base.getTopics());
+        assertSame(topics, BaseTest.getTopics());
     }
 
     @Test
@@ -264,11 +264,6 @@ public class BaseTestTest {
         verify(topics, times(2)).inject(eq(BaseTest.APPC_LCM_WRITE_TOPIC), any(), any());
     }
 
-    @Test
-    public void testTestVcpeSunnyDayLegacy() {
-        checkAppcLcmPolicy("restart", base::testVcpeSunnyDayLegacy);
-    }
-
     @Test
     public void testTestVcpeSunnyDayCompliant() {
         checkAppcLcmPolicy("restart", base::testVcpeSunnyDayCompliant);
@@ -295,11 +290,6 @@ public class BaseTestTest {
         verify(topics).inject(eq(BaseTest.APPC_LCM_WRITE_TOPIC), any(), any());
     }
 
-    @Test
-    public void testTestVdnsSunnyDayLegacy() {
-        checkHttpPolicy(base::testVdnsSunnyDayLegacy);
-    }
-
     @Test
     public void testTestVdnsSunnyDayCompliant() {
         checkHttpPolicy(base::testVdnsSunnyDayCompliant);
@@ -310,21 +300,11 @@ public class BaseTestTest {
         checkHttpPolicyCompliantFailure(base::testVdnsRainyDayCompliant);
     }
 
-    @Test
-    public void testTestVfwSunnyDayLegacy() {
-        checkAppcLegacyPolicy("ModifyConfig", base::testVfwSunnyDayLegacy);
-    }
-
     @Test
     public void testTestVfwSunnyDayCompliant() {
         checkAppcLegacyPolicy("ModifyConfig", base::testVfwSunnyDayCompliant);
     }
 
-    @Test
-    public void testTestVfwRainyDayLegacyFailure() {
-        checkAppcLegacyPolicyOperationFailure("ModifyConfig", base::testVfwRainyDayLegacyFailure);
-    }
-
     @Test
     public void testTestVfwRainyDayOverallTimeout() {
         checkAppcLegacyPolicyFinalFailure("ModifyConfig", base::testVfwRainyDayOverallTimeout);
@@ -335,21 +315,11 @@ public class BaseTestTest {
         checkAppcLegacyPolicyFinalFailure("ModifyConfig", base::testVfwRainyDayCompliantTimeout);
     }
 
-    @Test
-    public void testTestVpciSunnyDayLegacy() {
-        checkSdnrPolicy("ModifyConfig", base::testVpciSunnyDayLegacy);
-    }
-
     @Test
     public void testTestVpciSunnyDayCompliant() {
         checkSdnrPolicy("ModifyConfig", base::testVpciSunnyDayCompliant);
     }
 
-    @Test
-    public void testTestVsonhSunnyDayLegacy() {
-        checkSdnrPolicy("ModifyConfigANR", base::testVsonhSunnyDayLegacy);
-    }
-
     @Test
     public void testTestVsonhSunnyDayCompliant() {
         checkSdnrPolicy("ModifyConfigANR", base::testVsonhSunnyDayCompliant);
index a21fa0a..43392b9 100644 (file)
@@ -204,7 +204,7 @@ public class DroolsRuleTestTest {
 
     @Test
     public void testInit() {
-        assertSame(topics, base.getTopics());
+        assertSame(topics, BaseTest.getTopics());
         assertSame(controller, base.controller);
     }