Remove deprecated DMAAP dependency 01/137201/1
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 31 Jan 2024 10:39:45 +0000 (10:39 +0000)
committerAdheli Tavares <adheli.tavares@est.tech>
Fri, 9 Feb 2024 14:28:59 +0000 (14:28 +0000)
Issue-ID: POLICY-4402
Change-Id: Id3bf1f5833b7d6086345b3747505e2f57036d4ea
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
29 files changed:
controlloop/common/controller-usecases/src/main/resources/META-INF/kmodule.xml
controlloop/common/controller-usecases/src/main/resources/usecases.drl
controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java
controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties
controlloop/common/coordination/src/main/java/org/onap/policy/coordination/CoordinationDirective.java
controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/drl/legacy/ControlLoopParams.java
controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEvent.java
controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager.java
controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
controlloop/common/feature-controlloop-management/src/test/resources/op.kmodule
controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java
controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
controlloop/common/feature-controlloop-usecases/src/main/feature/config/usecases-controller.properties
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/SimulatorException.java
controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Simulators.java
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
controlloop/common/rules-test/src/test/resources/META-INF/kmodule.xml
pom.xml

index 7db705b..885568e 100644 (file)
@@ -4,6 +4,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2024 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -18,7 +19,7 @@
   limitations under the License.
   ============LICENSE_END=========================================================
   -->
-<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
+<kmodule xmlns="http://www.drools.org/xsd/kmodule">
     <kbase name="onap.policies.controlloop.operational.common.Drools" equalsBehavior="equality"
            packages="org.onap.policy.controlloop">
         <ksession name="usecases"/>
index 14bc9a4..70a1cd8 100644 (file)
@@ -174,7 +174,7 @@ rule "EVENT"
                 manager.start();
 
                 if (manager.getSteps().isEmpty()) {
-                    // no steps implies no policies, thus go straight to DONE state
+                    // no steps imply no policies, thus go straight to DONE state
                     manager.setState(State.DONE);
 
                     manager.setAccepted(true);
@@ -1095,7 +1095,7 @@ end
 rule "APPC-LCM.Response.CLEANUP"
     salience 1
     when
-        $msg : org.onap.policy.appclcm.AppcLcmDmaapWrapper( )
+        $msg : org.onap.policy.appclcm.AppcLcmMessageWrapper( )
     then
         retract($msg);
 end
index 3b64638..79ada39 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021, 2023 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -367,6 +367,8 @@ class UsecasesEventManagerTest {
 
     @Test
     void testStoreInDataBase() throws ControlLoopException {
+        when(services.getDataManager()).thenReturn(dataMgr);
+        when(workMem.getFactHandle(any())).thenReturn(factHandle);
         mgr.start();
         var outcome = makeOutcome();
         mgr.addToHistory(outcome);
index 67d0bc8..1bd4766 100644 (file)
@@ -40,8 +40,8 @@ noop.source.topics.appc-cl.events.org.onap.policy.appc.Response.filter=[?($.Comm
 noop.source.topics.appc-cl.events.org.onap.policy.appc.Request.filter=[?($.CommonHeader && $.Action)]
 noop.source.topics.appc-cl.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
 
-noop.source.topics.appc-lcm-write.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
-noop.source.topics.appc-lcm-write.events.org.onap.policy.appclcm.AppcLcmDmaapWrapper.filter=[?($.type == 'response')]
+noop.source.topics.appc-lcm-write.events=org.onap.policy.appclcm.AppcLcmMessageWrapper
+noop.source.topics.appc-lcm-write.events.org.onap.policy.appclcm.AppcLcmMessageWrapper.filter=[?($.type == 'response')]
 noop.source.topics.appc-lcm-write.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
 
 noop.source.topics.sdnr-cl-rsp.events=org.onap.policy.sdnr.PciResponseWrapper
@@ -55,7 +55,7 @@ noop.source.topics.a1-p-RSP.events.custom.gson=org.onap.policy.sdnr.util.Seriali
 noop.source.topics.policy-cl-mgt.events=org.onap.policy.controlloop.VirtualControlLoopNotification
 noop.source.topics.policy-cl-mgt.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
 
-noop.source.topics.appc-lcm-read.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
+noop.source.topics.appc-lcm-read.events=org.onap.policy.appclcm.AppcLcmMessageWrapper
 noop.source.topics.appc-lcm-read.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
 
 noop.sink.topics=appc-cl,appc-lcm-read,policy-cl-mgt,sdnr-cl,dcae_cl_rsp,a1-p
index 6ba4ca4..a136c7e 100644 (file)
@@ -3,6 +3,7 @@
  * guard
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.coordination;
 
 import java.util.List;
+import lombok.Getter;
+import lombok.Setter;
 
+@Setter
+@Getter
 public class CoordinationDirective {
 
     private List<String> controlLoop;
     private String coordinationFunction;
 
-    public List<String> getControlLoop() {
-        return controlLoop;
-    }
-
     /**
      * gets the ith control loop.
      *
@@ -41,18 +42,6 @@ public class CoordinationDirective {
         return controlLoop.get(index);
     }
 
-    public void setControlLoop(List<String> controlLoop) {
-        this.controlLoop = controlLoop;
-    }
-
-    public String getCoordinationFunction() {
-        return coordinationFunction;
-    }
-
-    public void setCoordinationFunction(String coordinationFunction) {
-        this.coordinationFunction = coordinationFunction;
-    }
-
     /**
      * toString.
      *
index 3eac661..014ccd4 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +21,7 @@
 
 package org.onap.policy.controlloop.drl.legacy;
 
+import java.io.Serial;
 import java.io.Serializable;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -29,6 +31,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 @NoArgsConstructor
 public class ControlLoopParams implements Serializable {
 
+    @Serial
     private static final long serialVersionUID = 970755684770982776L;
 
     private String closedLoopControlName;
index 5a0352b..bb322f8 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +21,7 @@
 
 package org.onap.policy.controlloop.eventmanager;
 
+import java.io.Serial;
 import java.util.HashMap;
 import lombok.AccessLevel;
 import lombok.Getter;
@@ -40,20 +42,20 @@ import org.slf4j.LoggerFactory;
  * Manager for a single control loop event. Once this has been created, the event can be
  * retracted from working memory.
  */
+@Getter
 public abstract class ClEventManagerWithEvent<T extends Step> extends ClEventManagerWithOutcome<T>
                 implements StepContext {
 
     private static final Logger logger = LoggerFactory.getLogger(ClEventManagerWithEvent.class);
+    @Serial
     private static final long serialVersionUID = -1216568161322872641L;
 
     public enum NewEventStatus {
         FIRST_ONSET, SUBSEQUENT_ONSET, FIRST_ABATEMENT, SUBSEQUENT_ABATEMENT, SYNTAX_ERROR
     }
 
-    @Getter
     private final VirtualControlLoopEvent event;
 
-    @Getter
     @Setter(AccessLevel.PROTECTED)
     private VirtualControlLoopEvent abatement = null;
 
index 354567c..f93b2ac 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +21,7 @@
 
 package org.onap.policy.controlloop.eventmanager;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.time.Instant;
 import java.util.Deque;
@@ -61,6 +63,7 @@ import org.slf4j.LoggerFactory;
 public class ControlLoopEventManager implements StepContext, Serializable {
 
     private static final Logger logger = LoggerFactory.getLogger(ControlLoopEventManager.class);
+    @Serial
     private static final long serialVersionUID = -1216568161322872641L;
 
     /**
@@ -81,7 +84,7 @@ public class ControlLoopEventManager implements StepContext, Serializable {
      * otherwise. This will be {@code false} if this object is reconstituted from a
      * persistent store or by transfer from another server.
      */
-    private transient boolean createdByThisJvmInstance;
+    private final transient boolean createdByThisJvmInstance;
 
     private final transient EventManagerServices services;
 
@@ -115,7 +118,7 @@ public class ControlLoopEventManager implements StepContext, Serializable {
     /**
      * Set of properties used while processing the event.
      */
-    private Map<String, Serializable> properties = new ConcurrentHashMap<>();
+    private final Map<String, Serializable> properties = new ConcurrentHashMap<>();
 
     /**
      * Unprocessed outcomes from the operations. Outcomes are added to this each time the
@@ -192,7 +195,7 @@ public class ControlLoopEventManager implements StepContext, Serializable {
      */
     private long detmControlLoopTimeoutMs() {
         // validation checks preclude null or 0 timeout values in the policy
-        Integer timeout = processor.getPolicy().getProperties().getTimeout();
+        int timeout = processor.getPolicy().getProperties().getTimeout();
         return TimeUnit.MILLISECONDS.convert(timeout, TimeUnit.SECONDS);
     }
 
index 8e9d2dc..60e5427 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-dmaap.source.topics=A1-P-RSP
-dmaap.source.topics.A1-P-RSP.servers=${envd:DMAAP_SERVERS}
-dmaap.source.topics.A1-P-RSP.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.source.topics=a1-p-rsp
-#kafka.source.topics.a1-p-rsp.servers=${envd:DMAAP_SERVERS}
-#kafka.source.topics.a1-p-rsp.https=${envd:DMAAP_HTTPS:true}
+kafka.source.topics=a1-p-rsp
+kafka.source.topics.a1-p-rsp.servers=${envd:KAFKA_SERVERS}
index 26591ba..d15f966 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-dmaap.sink.topics=A1-P
-
-dmaap.sink.topics.A1-P.servers=${envd:DMAAP_SERVERS}
-dmaap.sink.topics.A1-P.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.sink.topics=a1-p
-
-#kafka.sink.topics.A1-P.servers=${envd:DMAAP_SERVERS}
-#kafka.sink.topics.A1-P.https=${envd:DMAAP_HTTPS:true}
+kafka.sink.topics=a1-p
+kafka.sink.topics.A1-P.servers=${envd:KAFKA_SERVERS}
 
index f5b7c15..a2c3c62 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-dmaap.source.topics=APPC-CL
-dmaap.sink.topics=APPC-CL
-
-dmaap.source.topics.APPC-CL.servers=${envd:DMAAP_SERVERS}
-dmaap.source.topics.APPC-CL.https=${envd:DMAAP_HTTPS:true}
-
-dmaap.sink.topics.APPC-CL.servers=${envd:DMAAP_SERVERS}
-dmaap.sink.topics.APPC-CL.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.source.topics=appc-cl
-#kafka.sink.topics=appc-cl
-
-#kafka.source.topics.appc-cl.servers=${envd:DMAAP_SERVERS}
-#kafka.source.topics.appc-cl.https=${envd:DMAAP_HTTPS:true}
-
-#kafka.sink.topics.appc-cl.servers=${envd:DMAAP_SERVERS}
-#kafka.sink.topics.appc-cl.https=${envd:DMAAP_HTTPS:true}
+kafka.source.topics=appc-cl
+kafka.sink.topics=appc-cl
+kafka.source.topics.appc-cl.servers=${envd:KAFKA_SERVERS}
+kafka.sink.topics.appc-cl.servers=${envd:KAFKA_SERVERS}
index f50958f..dde79f8 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-dmaap.sink.topics=APPC-LCM-READ
-
-dmaap.sink.topics.APPC-LCM-READ.servers=${envd:DMAAP_SERVERS}
-dmaap.sink.topics.APPC-LCM-READ.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.sink.topics=appc-lcm-read
-
-#kafka.sink.topics.appc-lcm-read.servers=${envd:DMAAP_SERVERS}
-#kafka.sink.topics.appc-lcm-read.https=${envd:DMAAP_HTTPS:true}
-
+kafka.sink.topics=appc-lcm-read
+kafka.sink.topics.appc-lcm-read.servers=${envd:KAFKA_SERVERS}
index 414c3a2..261d745 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-dmaap.source.topics=APPC-LCM-WRITE
-
-dmaap.source.topics.APPC-LCM-WRITE.servers=${envd:DMAAP_SERVERS}
-dmaap.source.topics.APPC-LCM-WRITE.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.source.topics=appc-lcm-write
-
-#kafka.source.topics.appc-lcm-write.servers=${envd:DMAAP_SERVERS}
-#kafka.source.topics.appc-lcm-write.https=${envd:DMAAP_HTTPS:true}
+kafka.source.topics=appc-lcm-write
+kafka.source.topics.appc-lcm-write.servers=${envd:KAFKA_SERVERS}
index 54ce1aa..2c860f1 100644 (file)
@@ -2,7 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright (C) 2022 Nordix Foundation.
+# Modifications Copyright (C) 2022, 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-dmaap.sink.topics=DCAE_CL_RSP
-
-dmaap.sink.topics.DCAE_CL_RSP.servers=${env:DMAAP_SERVERS}
-dmaap.sink.topics.DCAE_CL_RSP.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.sink.topics=dcae-cl-rsp
-
-#kafka.sink.topics.dcae-cl-rsp.servers=${env:DMAAP_SERVERS}
-#kafka.sink.topics.dcae-cl-rsp.https=${envd:DMAAP_HTTPS:true}
+kafka.sink.topics=dcae-cl-rsp
+kafka.sink.topics.dcae-cl-rsp.servers=${env:KAFKA_SERVERS}
index d444df8..c7ff538 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-dmaap.source.topics=DCAE_TOPIC
-
-dmaap.source.topics.DCAE_TOPIC.effectiveTopic=${envd:DCAE_TOPIC}
-dmaap.source.topics.DCAE_TOPIC.servers=${envd:DMAAP_SERVERS}
-dmaap.source.topics.DCAE_TOPIC.consumerGroup=${envd:DCAE_CONSUMER_GROUP}
-dmaap.source.topics.DCAE_TOPIC.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.source.topics=dcae_topic
-
-#kafka.source.topics.dcae_topic.effectiveTopic=${envd:DCAE_TOPIC}
-#kafka.source.topics.dcae_topic.servers=${envd:DMAAP_SERVERS}
-#kafka.source.topics.dcae_topic.consumerGroup=${envd:DCAE_CONSUMER_GROUP}
-#kafka.source.topics.dcae_topic.https=${envd:DMAAP_HTTPS:true}
+kafka.source.topics=dcae_topic
+kafka.source.topics.dcae_topic.effectiveTopic=${envd:DCAE_TOPIC}
+kafka.source.topics.dcae_topic.servers=${envd:KAFKA_SERVERS}
+kafka.source.topics.dcae_topic.consumerGroup=${envd:DCAE_CONSUMER_GROUP}
index 74cf296..22fe4b2 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-dmaap.sink.topics=POLICY-CL-MGT
-dmaap.sink.topics.POLICY-CL-MGT.servers=${envd:DMAAP_SERVERS}
-dmaap.sink.topics.POLICY-CL-MGT.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.sink.topics=policy-cl-mgt
-#kafka.sink.topics.policy-cl-mgt.servers=${envd:DMAAP_SERVERS}
-#kafka.sink.topics.policy-cl-mgt.https=${envd:DMAAP_HTTPS:true}
+kafka.sink.topics=policy-cl-mgt
+kafka.sink.topics.policy-cl-mgt.servers=${envd:KAFKA_SERVERS}
index b3b8ee2..a76ca2c 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-dmaap.source.topics=SDNR-CL-RSP
-dmaap.source.topics.SDNR-CL-RSP.servers=${envd:DMAAP_SERVERS}
-dmaap.source.topics.SDNR-CL-RSP.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.source.topics=sdnr-cl-rsp
-#kafka.source.topics.sdnr-cl-rsp.servers=${envd:DMAAP_SERVERS}
-#kafka.source.topics.sdnr-cl-rsp.https=${envd:DMAAP_HTTPS:true}
+kafka.source.topics=sdnr-cl-rsp
+kafka.source.topics.sdnr-cl-rsp.servers=${envd:KAFKA_SERVERS}
index 1459435..4ddd007 100644 (file)
@@ -2,6 +2,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-
-
-dmaap.sink.topics=SDNR-CL
-
-dmaap.sink.topics.SDNR-CL.servers=${envd:DMAAP_SERVERS}
-dmaap.sink.topics.SDNR-CL.https=${envd:DMAAP_HTTPS:true}
-
-#Replace the properties with the following to use kafka message broker
-#kafka.sink.topics=sdnr-cl
-
-#kafka.sink.topics.sdnr-cl.servers=${envd:DMAAP_SERVERS}
-#kafka.sink.topics.sdnr-cl.https=${envd:DMAAP_HTTPS:true}
-
+kafka.sink.topics=sdnr-cl
+kafka.sink.topics.sdnr-cl.servers=${envd:KAFKA_SERVERS}
index 8b49eb6..f033fc2 100644 (file)
@@ -4,6 +4,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2024 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -19,7 +20,7 @@
   ============LICENSE_END=========================================================
   -->
 
-<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
+<kmodule xmlns="http://www.drools.org/xsd/kmodule">
     <kbase name="kbop">
         <ksession name="op"/>
     </kbase>
index 77ce83b..164cdb7 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -96,13 +96,13 @@ class ControlLoopMetricsFeatureTest {
     void testInvalidNotifications() {
         var feature = new ControlLoopMetricsFeature();
         var notification = new VirtualControlLoopNotification();
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
         this.testCacheDefaults();
 
         var requestId = UUID.randomUUID();
         notification.setRequestId(requestId);
 
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
         assertNull(ControlLoopMetricsManager.getManager().getTransaction(requestId));
         this.testCacheDefaults();
     }
@@ -115,7 +115,7 @@ class ControlLoopMetricsFeatureTest {
         notification.setRequestId(requestId);
         notification.setNotification(ControlLoopNotificationType.ACTIVE);
 
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
         assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(requestId));
         assertTrue(ControlLoopMetricsManager.getManager().getTransaction(requestId).getFrom()
                         .contains(testController.getName()));
@@ -132,7 +132,7 @@ class ControlLoopMetricsFeatureTest {
     @Test
     void testReset() {
         var notification = this.generateNotification();
-        new ControlLoopMetricsFeature().beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT,
+        new ControlLoopMetricsFeature().beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT,
                 notification);
 
         assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
@@ -160,7 +160,7 @@ class ControlLoopMetricsFeatureTest {
         var feature = new ControlLoopMetricsFeature();
         for (int i = 0; i < ControlLoopMetricsManager.getManager().getCacheSize(); i++) {
             var notification = generateNotification();
-            feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+            feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
             assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
         }
 
@@ -168,7 +168,7 @@ class ControlLoopMetricsFeatureTest {
                         ControlLoopMetricsManager.getManager().getCacheOccupancy());
 
         var overflowNotification = generateNotification();
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, overflowNotification);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, overflowNotification);
         assertEquals(ControlLoopMetricsManager.getManager().getCacheOccupancy(),
                         ControlLoopMetricsManager.getManager().getCacheOccupancy());
         assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(overflowNotification.getRequestId()));
@@ -215,39 +215,39 @@ class ControlLoopMetricsFeatureTest {
         var activeNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-active.json");
         var active =
                 Serialization.gsonPretty.fromJson(activeNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, active);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, active);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var opStartNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-operation.json");
         var opStart =
                 Serialization.gsonPretty.fromJson(opStartNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, opStart);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, opStart);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var permitNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-permit.json");
         var permit =
                 Serialization.gsonPretty.fromJson(permitNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, permit);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, permit);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var restartNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-restart.json");
         var restart =
                 Serialization.gsonPretty.fromJson(restartNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, restart);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, restart);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var restartSuccessNotification =
                 ResourceUtils.getResourceAsString("policy-cl-mgt-restart-success.json");
         var restartSuccess =
                 Serialization.gsonPretty.fromJson(restartSuccessNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, restartSuccess);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, restartSuccess);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var finalSuccessNotification =
                 ResourceUtils.getResourceAsString("policy-cl-mgt-final-success.json");
         var finalSuccess =
                 Serialization.gsonPretty.fromJson(finalSuccessNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, finalSuccess);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, finalSuccess);
         assertEquals(0, ControlLoopMetricsManager.getManager().getTransactionIds().size());
         assertEquals(1,
                 PolicyEngineConstants.getManager().getStats().getGroupStat().getPolicyExecutedSuccessCount());
@@ -273,14 +273,14 @@ class ControlLoopMetricsFeatureTest {
         var finalSuccess =
                 Serialization.gsonPretty.fromJson(finalSuccessNotification, VirtualControlLoopNotification.class);
         finalSuccess.setRequestId(UUID.randomUUID());
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, finalSuccess);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, finalSuccess);
         assertEquals(0, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         var opStartNotification =
                 ResourceUtils.getResourceAsString("policy-cl-mgt-operation.json");
         var opStart =
                 Serialization.gsonPretty.fromJson(opStartNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, opStart);
+        feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, opStart);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         Thread.sleep((ControlLoopMetricsManager.getManager().getTransactionTimeout() + 1) * 1000L);  // NOSONAR
index 39adb81..1ada271 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -123,7 +123,7 @@ class RestTransactionTrackerTest {
         var activeNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-active.json");
         var active =
                 Serialization.gsonPretty.fromJson(activeNotification, VirtualControlLoopNotification.class);
-        feature.beforeDeliver(testController, Topic.CommInfrastructure.DMAAP, "POLICY-CL-MGT", active);
+        feature.beforeDeliver(testController, Topic.CommInfrastructure.NOOP, "POLICY-CL-MGT", active);
         assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
 
         assertFalse(HttpClient.getBody(get("/inprogress", Response.Status.OK.getStatusCode()),
index 73c4112..5cf3ce2 100644 (file)
@@ -3,6 +3,7 @@
 # ONAP
 # ================================================================================
 # Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 
 controller.name=usecases
 
-dmaap.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP
-dmaap.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP
+kafka.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP
+kafka.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP
 
-dmaap.source.topics.DCAE_TOPIC.events=\
+kafka.source.topics.DCAE_TOPIC.events=\
     org.onap.policy.controlloop.CanonicalOnset,org.onap.policy.controlloop.CanonicalAbated
-dmaap.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalOnset.\
+kafka.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalOnset.\
     filter=[?($.closedLoopEventStatus == 'ONSET')]
-dmaap.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalAbated.\
+kafka.source.topics.DCAE_TOPIC.events.org.onap.policy.controlloop.CanonicalAbated.\
     filter=[?($.closedLoopEventStatus == 'ABATED')]
-dmaap.source.topics.DCAE_TOPIC.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gson
+kafka.source.topics.DCAE_TOPIC.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gson
 
-dmaap.source.topics.APPC-CL.events=org.onap.policy.appc.Response
-dmaap.source.topics.APPC-CL.events.org.onap.policy.appc.Response.filter=[?($.CommonHeader && $.Status)]
-dmaap.source.topics.APPC-CL.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
+kafka.source.topics.APPC-CL.events=org.onap.policy.appc.Response
+kafka.source.topics.APPC-CL.events.org.onap.policy.appc.Response.filter=[?($.CommonHeader && $.Status)]
+kafka.source.topics.APPC-CL.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
 
-dmaap.source.topics.APPC-LCM-WRITE.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
-dmaap.source.topics.APPC-LCM-WRITE.events.org.onap.policy.appclcm.AppcLcmDmaapWrapper.filter=[?($.type == 'response')]
-dmaap.source.topics.APPC-LCM-WRITE.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
+kafka.source.topics.APPC-LCM-WRITE.events=org.onap.policy.appclcm.AppcLcmMessageWrapper
+kafka.source.topics.APPC-LCM-WRITE.events.org.onap.policy.appclcm.AppcLcmMessageWrapper.filter=[?($.type == 'response')]
+kafka.source.topics.APPC-LCM-WRITE.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
 
-dmaap.sink.topics.APPC-CL.events=org.onap.policy.appc.Request
-dmaap.sink.topics.APPC-CL.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
+kafka.sink.topics.APPC-CL.events=org.onap.policy.appc.Request
+kafka.sink.topics.APPC-CL.events.custom.gson=org.onap.policy.appc.util.Serialization,gsonPretty
 
-dmaap.sink.topics.APPC-LCM-READ.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper
-dmaap.sink.topics.APPC-LCM-READ.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
+kafka.sink.topics.APPC-LCM-READ.events=org.onap.policy.appclcm.AppcLcmMessageWrapper
+kafka.sink.topics.APPC-LCM-READ.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson
 
-dmaap.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
-dmaap.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
+kafka.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification
+kafka.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
 
-dmaap.sink.topics.SDNR-CL.events=org.onap.policy.sdnr.PciRequestWrapper
-dmaap.sink.topics.SDNR-CL.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
+kafka.sink.topics.SDNR-CL.events=org.onap.policy.sdnr.PciRequestWrapper
+kafka.sink.topics.SDNR-CL.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
 
-dmaap.sink.topics.DCAE_CL_RSP.events=org.onap.policy.controlloop.ControlLoopResponse
-dmaap.sink.topics.DCAE_CL_RSP.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
+kafka.sink.topics.DCAE_CL_RSP.events=org.onap.policy.controlloop.ControlLoopResponse
+kafka.sink.topics.DCAE_CL_RSP.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty
 
-dmaap.source.topics.SDNR-CL-RSP.events=org.onap.policy.sdnr.PciResponseWrapper
-dmaap.source.topics.SDNR-CL-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')]
-dmaap.source.topics.SDNR-CL-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
+kafka.source.topics.SDNR-CL-RSP.events=org.onap.policy.sdnr.PciResponseWrapper
+kafka.source.topics.SDNR-CL-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')]
+kafka.source.topics.SDNR-CL-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson
 
 rules.groupId=${project.groupId}
 rules.artifactId=controller-usecases
index 3219382..15e03e6 100644 (file)
@@ -37,7 +37,7 @@ import org.apache.commons.collections.MapUtils;
 import org.awaitility.Awaitility;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.appc.Request;
-import org.onap.policy.appclcm.AppcLcmDmaapWrapper;
+import org.onap.policy.appclcm.AppcLcmMessageWrapper;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -161,7 +161,7 @@ public abstract class BaseTest {
     // used to wait for messages on SINK topics
     protected Listener<VirtualControlLoopNotification> policyClMgt;
     protected Listener<Request> appcClSink;
-    protected Listener<AppcLcmDmaapWrapper> appcLcmRead;
+    protected Listener<AppcLcmMessageWrapper> appcLcmRead;
     protected Listener<PciMessage> sdnrClSink;
 
     /*
@@ -212,7 +212,7 @@ public abstract class BaseTest {
     //TODO This test needs to be enabled in java-17 branch
     public void testService123Compliant() {
         policyClMgt = createNoficationTopicListener();
-        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER);
+        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER);
         policy = checkPolicy(SERVICE123_TOSCA_COMPLIANT_POLICY);
 
         // inject an ONSET event over the DCAE topic
@@ -223,13 +223,13 @@ public abstract class BaseTest {
 
         // restart request should be sent and fail four times (i.e., because retry=3)
         for (var count = 0; count < 4; ++count) {
-            AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName()));
+            AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName()));
 
             topics.inject(APPC_LCM_WRITE_TOPIC, SERVICE123_APPC_RESTART_FAILURE,
                             appcreq.getBody().getInput().getCommonHeader().getSubRequestId());
         }
         // rebuild request should be sent and fail once
-        AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> "rebuild".equals(req.getRpcName()));
+        AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> "rebuild".equals(req.getRpcName()));
         topics.inject(APPC_LCM_WRITE_TOPIC, SERVICE123_APPC_REBUILD_FAILURE,
                         appcreq.getBody().getInput().getCommonHeader().getSubRequestId());
         // migrate request should be sent and succeed
@@ -258,7 +258,7 @@ public abstract class BaseTest {
     //TODO This test needs to be enabled in java-17 branch
     public void testDuplicatesEvents() {
         policyClMgt = createNoficationTopicListener();
-        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER);
+        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER);
 
         policy = checkPolicy(DUPLICATES_TOSCA_COMPLIANT_POLICY);
 
@@ -275,7 +275,7 @@ public abstract class BaseTest {
 
         // should see two restarts
         for (var count = 0; count < 2; ++count) {
-            AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName()));
+            AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName()));
 
             // indicate success
             topics.inject(APPC_LCM_WRITE_TOPIC, DUPLICATES_APPC_SUCCESS,
@@ -422,7 +422,7 @@ public abstract class BaseTest {
      */
     protected void appcLcmSunnyDay(String policyFile, List<String> onsetFiles, String operation) {
         policyClMgt = createNoficationTopicListener();
-        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER);
+        appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER);
 
         policy = checkPolicy(policyFile);
 
@@ -438,7 +438,7 @@ public abstract class BaseTest {
         /*
          * Ensure that an APPC RESTART request was sent in response to the matching ONSET
          */
-        AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> operation.equals(req.getRpcName()));
+        AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> operation.equals(req.getRpcName()));
 
         /*
          * Inject a 400 APPC Response Return over the APPC topic, with appropriate
index f9880d0..73dd2b3 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.controlloop.common.rules.test;
 
+import java.io.Serial;
+
 /**
  * Exception thrown by <i>Simulators</i>.
  */
 public class SimulatorException extends RuntimeException {
+    @Serial
     private static final long serialVersionUID = 1L;
 
     public SimulatorException() {
index b1d3d54..5e1a33d 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -57,7 +58,7 @@ public class Simulators {
     }
 
     /**
-     * Stops all of the simulators.
+     * Stops all the simulators.
      */
     public void destroy() {
         for (HttpServletServer server : servers) {
@@ -72,7 +73,7 @@ public class Simulators {
     }
 
     @FunctionalInterface
-    public static interface SimulatorBuilder {
-        public HttpServletServer build() throws InterruptedException;
+    public interface SimulatorBuilder {
+        HttpServletServer build() throws InterruptedException;
     }
 }
index cc2bda0..2bd6a89 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,8 +47,8 @@ import org.onap.policy.appc.CommonHeader;
 import org.onap.policy.appc.Request;
 import org.onap.policy.appclcm.AppcLcmBody;
 import org.onap.policy.appclcm.AppcLcmCommonHeader;
-import org.onap.policy.appclcm.AppcLcmDmaapWrapper;
 import org.onap.policy.appclcm.AppcLcmInput;
+import org.onap.policy.appclcm.AppcLcmMessageWrapper;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.coder.StandardCoderInstantAsMillis;
 import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -72,7 +72,7 @@ class BaseTestTest {
 
     private BaseTest base;
     private LinkedList<VirtualControlLoopNotification> clMgtQueue;
-    private Queue<AppcLcmDmaapWrapper> appcLcmQueue;
+    private Queue<AppcLcmMessageWrapper> appcLcmQueue;
     private Queue<Request> appcLegacyQueue;
     private Queue<PciMessage> sdnrQueue;
     private int permitCount;
@@ -83,7 +83,7 @@ class BaseTestTest {
     private final Topics topics = mock(Topics.class);
     private final Listener<VirtualControlLoopNotification> policyClMgt = mock();
     private final Listener<Request> appcClSink = mock();
-    private final Listener<AppcLcmDmaapWrapper> appcLcmRead = mock();
+    private final Listener<AppcLcmMessageWrapper> appcLcmRead = mock();
     private final Listener<PciMessage> sdnrClSink = mock();
     private final DroolsController drools = mock(DroolsController.class);
     private final ToscaPolicy policy = mock(ToscaPolicy.class);
@@ -117,7 +117,7 @@ class BaseTestTest {
     public void setUp() {
         when(topics.createListener(eq(BaseTest.POLICY_CL_MGT_TOPIC), eq(VirtualControlLoopNotification.class),
                         any(StandardCoder.class))).thenReturn(policyClMgt);
-        when(topics.createListener(eq(BaseTest.APPC_LCM_READ_TOPIC), eq(AppcLcmDmaapWrapper.class),
+        when(topics.createListener(eq(BaseTest.APPC_LCM_READ_TOPIC), eq(AppcLcmMessageWrapper.class),
                         any(StandardCoder.class))).thenReturn(appcLcmRead);
         when(topics.createListener(eq(BaseTest.APPC_CL_TOPIC), eq(Request.class),
                         any(StandardCoderInstantAsMillis.class))).thenReturn(appcClSink);
@@ -145,8 +145,8 @@ class BaseTestTest {
         });
 
         when(appcLcmRead.await(any())).thenAnswer(args -> {
-            AppcLcmDmaapWrapper req = appcLcmQueue.remove();
-            Predicate<AppcLcmDmaapWrapper> pred = args.getArgument(0);
+            AppcLcmMessageWrapper req = appcLcmQueue.remove();
+            Predicate<AppcLcmMessageWrapper> pred = args.getArgument(0);
             assertTrue(pred.test(req));
             return req;
         });
@@ -448,7 +448,7 @@ class BaseTestTest {
 
     private void enqueueAppcLcm(String... operationNames) {
         for (var oper : operationNames) {
-            var req = new AppcLcmDmaapWrapper();
+            var req = new AppcLcmMessageWrapper();
             req.setRpcName(oper);
 
             var body = new AppcLcmBody();
index 0b859ad..c3c82d5 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2021,2023 Nordix Foundation.
+ * Modifications Copyright (C) 2021, 2023-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@ import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.appclcm.AppcLcmBody;
 import org.onap.policy.appclcm.AppcLcmCommonHeader;
-import org.onap.policy.appclcm.AppcLcmDmaapWrapper;
 import org.onap.policy.appclcm.AppcLcmInput;
+import org.onap.policy.appclcm.AppcLcmMessageWrapper;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.controlloop.ControlLoopNotificationType;
 import org.onap.policy.controlloop.VirtualControlLoopNotification;
@@ -66,7 +66,7 @@ class DroolsRuleTestTest {
 
     private DroolsRuleTest base;
     private LinkedList<VirtualControlLoopNotification> clMgtQueue;
-    private Queue<AppcLcmDmaapWrapper> appcLcmQueue;
+    private Queue<AppcLcmMessageWrapper> appcLcmQueue;
     private int permitCount;
     private int finalCount;
 
@@ -76,7 +76,7 @@ class DroolsRuleTestTest {
     private final Simulators simulators = mock(Simulators.class);
     private final Topics topics = mock(Topics.class);
     private final Listener<VirtualControlLoopNotification> policyClMgt = mock();
-    private final Listener<AppcLcmDmaapWrapper> appcLcmRead = mock();
+    private final Listener<AppcLcmMessageWrapper> appcLcmRead = mock();
     private final DroolsController drools = mock(DroolsController.class);
     private final ToscaPolicy policy = mock(ToscaPolicy.class);
 
@@ -113,7 +113,7 @@ class DroolsRuleTestTest {
 
         when(topics.createListener(DroolsRuleTest.POLICY_CL_MGT_TOPIC,
              VirtualControlLoopNotification.class, controller)).thenReturn(policyClMgt);
-        when(topics.createListener(eq(DroolsRuleTest.APPC_LCM_READ_TOPIC), eq(AppcLcmDmaapWrapper.class),
+        when(topics.createListener(eq(DroolsRuleTest.APPC_LCM_READ_TOPIC), eq(AppcLcmMessageWrapper.class),
                         any(StandardCoder.class))).thenReturn(appcLcmRead);
 
         Function<String, Rules> ruleMaker = this::makeRules;
@@ -137,8 +137,8 @@ class DroolsRuleTestTest {
         });
 
         when(appcLcmRead.await(any())).thenAnswer(args -> {
-            AppcLcmDmaapWrapper req = appcLcmQueue.remove();
-            Predicate<AppcLcmDmaapWrapper> pred = args.getArgument(0);
+            AppcLcmMessageWrapper req = appcLcmQueue.remove();
+            Predicate<AppcLcmMessageWrapper> pred = args.getArgument(0);
             assertTrue(pred.test(req));
             return req;
         });
@@ -204,7 +204,7 @@ class DroolsRuleTestTest {
 
     private void enqueueAppcLcm(String... operationNames) {
         for (String oper : operationNames) {
-            AppcLcmDmaapWrapper req = new AppcLcmDmaapWrapper();
+            AppcLcmMessageWrapper req = new AppcLcmMessageWrapper();
             req.setRpcName(oper);
 
             AppcLcmBody body = new AppcLcmBody();
index 9ace783..fd06328 100644 (file)
@@ -4,6 +4,7 @@
   ONAP
   ================================================================================
   Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+  Modifications Copyright (C) 2024 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -18,7 +19,7 @@
   limitations under the License.
   ============LICENSE_END=========================================================
   -->
-<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
+<kmodule xmlns="http://www.drools.org/xsd/kmodule">
     <kbase name="onap.policies.controlloop.operational.common.Drools" equalsBehavior="equality"
            packages="org.onap.policy.controlloop">
         <ksession name="rulesTest"/>
diff --git a/pom.xml b/pom.xml
index c341040..33e46a8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
   drools-pdp-apps
   ================================================================================
   Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
-  Modifications Copyright (C) 2019,2023 Nordix Foundation.
+  Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-test</artifactId>