Reenable tests for the so-bpmn-building-blocks module 31/140231/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sat, 15 Feb 2025 18:30:38 +0000 (19:30 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Sat, 15 Feb 2025 19:19:56 +0000 (20:19 +0100)
- adjust test properties after the dmaap to kafka migration
- fix wrong SDNC response in SDNCHandlerTest (after the RFC 8040 migration)
- compile the jsonpath pattern in SDNCRequestTasks on the class level
  to improve performance of the operation

Issue-ID: SO-4143
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I8da50b1e5596d067a61d5264e88f9b544b7dc980

bpmn/so-bpmn-building-blocks/pom.xml
bpmn/so-bpmn-building-blocks/src/test/resources/SDNCClientPut200Response.json
bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java

index fdb86e2..97fb26a 100644 (file)
@@ -44,7 +44,7 @@
 
     <pluginManagement>
       <plugins>
-        <!--This plugin's configuration is used to store Eclipse m2e settings 
+        <!--This plugin's configuration is used to store Eclipse m2e settings
                                        only. It has no influence on the Maven build itself. -->
         <plugin>
           <groupId>org.eclipse.m2e</groupId>
     <dependency>
       <groupId>org.springframework.cloud</groupId>
       <artifactId>spring-cloud-contract-wiremock</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 </project>
index 286ce4c..2d98067 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "output": {
+  "GENERIC-RESOURCE-API:output": {
     "svc-request-id": "5d24d40e-4c77-4c06-94a3-6d168c47a57c",
     "network-response-information": {
       "instance-id": "4063e0aa-af13-4872-8473-b40c94f9316b",
index 14640f4..71adc0d 100644 (file)
@@ -109,7 +109,7 @@ mso:
   request:
     db:
       endpoint: http://localhost:28090/
-  rollback: 'true'  
+  rollback: 'true'
   service:
     agnostic:
       sniro:
@@ -123,7 +123,7 @@ mso:
         2vvig: SNIRO.DistanceToLocationPolicy_vhngw,SNIRO.VNFPolicy_vhngatewayprimary1_v1,SNIRO.ResourceInstancePolicy_hngateway,SNIRO.ResourceRegionPolicy_hngateway_v1,SNIRO.VNFPolicy_vhngatewaysecondary1_v1,SNIRO.ZonePolicy_vhngw,SNIRO.PlacementOptimizationPolicy_dhv_v3,SNIRO.VNFPolicy_vhnportal_primary1_v1,SNIRO.ResourceInstancePolicy_vhnportal_v3,SNIRO.ResourceRegionPolicy_vhnportal_v1,SNIRO.VNFPolicy_vhnportalsecondary1_v1,SNIRO.ZonePolicy_vhnportal,SNIRO.DistanceToLocationPolicy_vvig,SNIRO.InventoryGroupPolicy_vvig,SNIRO.VNFPolicy_vvigprimary1_v1,SNIRO.ResourceInstancePolicy_vvig,SNIRO.VNFPolicy_vvigsecondary1_v1
         4vvig: SNIRO.DistanceToLocationPolicy_vhngw,SNIRO.VNFPolicy_vhngatewayprimary1_v1,SNIRO.ResourceInstancePolicy_hngateway,SNIRO.ResourceRegionPolicy_hngateway_v1,SNIRO.VNFPolicy_vhngatewaysecondary1_v1,SNIRO.ZonePolicy_vhngw,SNIRO.PlacementOptimizationPolicy_dhv_v3,SNIRO.VNFPolicy_vhnportal_primary1_v1,SNIRO.ResourceInstancePolicy_vhnportal_v3,SNIRO.ResourceRegionPolicy_vhnportal_v1,SNIRO.VNFPolicy_vhnportalsecondary1_v1,SNIRO.ZonePolicy_vhnportal,SNIRO.VNFPolicy_vvigprimary2_v1,SNIRO.VNFPolicy_vvigsecondary2_v1,SNIRO.DistanceToLocationPolicy_vvig,SNIRO.InventoryGroupPolicy_vvig,SNIRO.VNFPolicy_vvigprimary1_v1,SNIRO.ResourceInstancePolicy_vvig,SNIRO.VNFPolicy_vvigsecondary1_v1
     timeout: PT30M
-  workflow:    
+  workflow:
     default:
       aai:
         cloud-region:
@@ -210,12 +210,11 @@ camunda:
     job-execution:
       deployment-aware: true
 pnf:
-  dmaap:
-    host: hostTest
-    port: 1234
-    protocol: http
-    uriPathPrefix: events
-    topicName: pnfReady
-    consumerGroup: consumerGroup
-    consumerId: consumerId
+  kafka:
+    pnfReadyTopicName: unauthenticated.PNF_READY
+    pnfUpdateTopicName: unauthenticated.PNF_UPDATE
+    consumerGroup: so-consumer
+    consumerId: so-bpmn-infra-pnfready
+    consumerIdUpdate: so-bpmn-infra-pnfupdate
+    kafkaBootstrapServers:  localhost:9092
     topicListenerDelayInSeconds: 5
index e52866e..4dee6f1 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -55,13 +55,11 @@ import net.sf.saxon.xpath.XPathFactoryImpl;
 @Component
 public class SDNCRequestTasks {
 
+    private static final Logger logger = LoggerFactory.getLogger(SDNCRequestTasks.class);
     private static final String NET_SF_SAXON_XPATH_IMPL = "net.sf.saxon.xpath.XPathFactoryImpl";
-
     private static final String XPATH_FACTORY_PROPERTY_NAME =
             "javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON;
-
-    private static final Logger logger = LoggerFactory.getLogger(SDNCRequestTasks.class);
-
+    private static final JsonPath path = JsonPath.compile("$.GENERIC-RESOURCE-API:output.ack-final-indicator");
     private static final String SDNC_REQUEST = "SDNCRequest";
     private static final String MESSAGE = "_MESSAGE";
     private static final String CORRELATOR = "_CORRELATOR";
@@ -85,7 +83,7 @@ public class SDNCRequestTasks {
         try {
             String response = sdncClient.post(request.getSDNCPayload(), request.getTopology());
             // SDNC Response with RFC-8040 prefixes GENERIC-RESOURCE-API
-            String finalMessageIndicator = JsonPath.read(response, "$.GENERIC-RESOURCE-API:output.ack-final-indicator");
+            String finalMessageIndicator = path.read(response);
             execution.setVariable("isSDNCCompleted", convertIndicatorToBoolean(finalMessageIndicator));
         } catch (PathNotFoundException e) {
             logger.error("Error Parsing SDNC Response. Could not find read final ack indicator from JSON.", e);