Merge "Migrate query tests to integration-test module #4"
authorSourabh Sourabh <sourabh.sourabh@est.tech>
Tue, 11 Apr 2023 09:06:58 +0000 (09:06 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 11 Apr 2023 09:06:58 +0000 (09:06 +0000)
21 files changed:
checkstyle/pom.xml
cps-application/pom.xml
cps-bom/pom.xml
cps-dependencies/pom.xml
cps-events/pom.xml
cps-ncmp-events/pom.xml
cps-ncmp-rest-stub/pom.xml
cps-ncmp-rest/pom.xml
cps-ncmp-service/pom.xml
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionEventConsumer.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/avc/SubscriptionEventConsumerSpec.groovy
cps-parent/pom.xml
cps-path-parser/pom.xml
cps-rest/pom.xml
cps-ri/pom.xml
cps-service/pom.xml
integration-test/pom.xml
jacoco-report/pom.xml
pom.xml
spotbugs/pom.xml
version.properties

index 71ff88c..59af7a4 100644 (file)
@@ -26,7 +26,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>checkstyle</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
 
     <profiles>
         <profile>
index cf5de3c..4c46e46 100755 (executable)
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 88c78fa..c9af839 100644 (file)
@@ -25,7 +25,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-bom</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <description>This artifact contains dependencyManagement declarations of all published CPS components.</description>
index 506ed9f..770a66a 100755 (executable)
@@ -27,7 +27,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-dependencies</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>${project.groupId}:${project.artifactId}</name>
index 8fa2380..be0f4a7 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 890fa0e..494e126 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index c6eb0d7..af289cb 100644 (file)
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index bbf6b96..ecf66fc 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 1d7ca38..07ce152 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 1361d98..2685ce4 100644 (file)
@@ -44,6 +44,9 @@ public class SubscriptionEventConsumer {
     @Value("${notification.enabled:true}")
     private boolean notificationFeatureEnabled;
 
+    @Value("${ncmp.model-loader.subscription:false}")
+    private boolean subscriptionModelLoaderEnabled;
+
     /**
      * Consume the specified event.
      *
@@ -60,7 +63,9 @@ public class SubscriptionEventConsumer {
         }
         if ("CM".equals(event.getDataType().getDataCategory())) {
             log.debug("Consuming event {} ...", subscriptionEvent);
-            persistSubscriptionEvent(subscriptionEvent);
+            if (subscriptionModelLoaderEnabled) {
+                persistSubscriptionEvent(subscriptionEvent);
+            }
             if ("CREATE".equals(subscriptionEvent.getEventType().value())) {
                 log.info("Subscription for ClientID {} with name {} ...",
                         event.getSubscription().getClientID(),
index 248eb8b..d801e4d 100644 (file)
@@ -50,6 +50,8 @@ class SubscriptionEventConsumerSpec extends MessagingBaseSpec {
             def testEventSent = jsonObjectMapper.convertJsonString(jsonData, SubscriptionEvent.class)
         and: 'notifications are enabled'
             objectUnderTest.notificationFeatureEnabled = true
+        and: 'subscription model loader is enabled'
+            objectUnderTest.subscriptionModelLoaderEnabled = true
         when: 'the valid event is consumed'
             objectUnderTest.consumeSubscriptionEvent(testEventSent)
         then: 'the event is mapped to a yangModelSubscription'
@@ -60,18 +62,20 @@ class SubscriptionEventConsumerSpec extends MessagingBaseSpec {
             1 * mockSubscriptionEventForwarder.forwardCreateSubscriptionEvent(testEventSent)
     }
 
-    def 'Consume and persist valid CM create message where notifications are disabled'() {
+    def 'Consume valid CM create message where notifications and model loader are disabled'() {
         given: 'an event with data category CM'
             def jsonData = TestUtils.getResourceFileContent('avcSubscriptionCreationEvent.json')
             def testEventSent = jsonObjectMapper.convertJsonString(jsonData, SubscriptionEvent.class)
         and: 'notifications are disabled'
             objectUnderTest.notificationFeatureEnabled = false
+        and: 'subscription model loader is disabled'
+            objectUnderTest.subscriptionModelLoaderEnabled = false
         when: 'the valid event is consumed'
             objectUnderTest.consumeSubscriptionEvent(testEventSent)
-        then: 'the event is mapped to a yangModelSubscription'
-            1 * mockSubscriptionEventMapper.toYangModelSubscriptionEvent(testEventSent) >> yangModelSubscriptionEvent
-        and: 'the event is persisted'
-            1 * mockSubscriptionPersistence.saveSubscriptionEvent(yangModelSubscriptionEvent)
+        then: 'the event is not mapped to a yangModelSubscription'
+            0 * mockSubscriptionEventMapper.toYangModelSubscriptionEvent(*_) >> yangModelSubscriptionEvent
+        and: 'the event is not persisted'
+            0 * mockSubscriptionPersistence.saveSubscriptionEvent(*_)
         and: 'the event is not forwarded'
             0 * mockSubscriptionEventForwarder.forwardCreateSubscriptionEvent(*_)
     }
index 193a04e..829ab04 100755 (executable)
@@ -32,7 +32,7 @@
 
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-parent</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
index 0784ccb..5b861f7 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index c27e515..9d4f633 100755 (executable)
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index ba743f2..f282069 100644 (file)
@@ -26,7 +26,7 @@
     <parent>\r
         <groupId>org.onap.cps</groupId>\r
         <artifactId>cps-parent</artifactId>\r
-        <version>3.2.7-SNAPSHOT</version>\r
+        <version>3.3.0-SNAPSHOT</version>\r
         <relativePath>../cps-parent/pom.xml</relativePath>\r
     </parent>\r
 \r
index 86fef36..47f5508 100644 (file)
@@ -29,7 +29,7 @@
   <parent>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-parent</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
     <relativePath>../cps-parent/pom.xml</relativePath>
   </parent>
 
index 1d37fc1..acba37b 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index ddaf14b..8241ebc 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.2.7-SNAPSHOT</version>
+        <version>3.3.0-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 0997698..63afbf1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 \r
     <groupId>org.onap.cps</groupId>\r
     <artifactId>cps-aggregator</artifactId>\r
-    <version>3.2.7-SNAPSHOT</version>\r
+    <version>3.3.0-SNAPSHOT</version>\r
     <packaging>pom</packaging>\r
 \r
     <name>cps</name>\r
index e2d5774..7385805 100644 (file)
@@ -25,7 +25,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>spotbugs</artifactId>
-    <version>3.2.7-SNAPSHOT</version>
+    <version>3.3.0-SNAPSHOT</version>
 
     <properties>
         <nexusproxy>https://nexus.onap.org</nexusproxy>
index 169b253..0777f6b 100755 (executable)
@@ -21,8 +21,8 @@
 # because they are used in Jenkins, whose plug-in doesn't support this
 
 major=3
-minor=2
-patch=7
+minor=3
+patch=0
 
 base_version=${major}.${minor}.${patch}