aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2025-02-15 19:30:38 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2025-02-15 20:19:56 +0100
commit01e14ec1feaedc6b8c88bf58edcf7ad636f5a3d8 (patch)
tree477b9975d66903dd12f2332f264cd561c42cb235 /bpmn/so-bpmn-tasks
parent951c9443a60809b014f4c02d4d9f003c6ff729c5 (diff)
Reenable tests for the so-bpmn-building-blocks module
- 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
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
index e52866e1af..4dee6f12ba 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
@@ -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);