From 3e5957464b6b4fa18bcae18bcfdce5fc9bace787 Mon Sep 17 00:00:00 2001 From: Niranjana Date: Fri, 23 Jul 2021 05:27:44 +0000 Subject: Support for Multiple xpath queries in single api query Issue-ID: CPS-510 Signed-off-by: Niranjana Change-Id: I79c41d8028355a205d6d1e7808f64447dd94a28b --- .../onap/cps/tbdmt/rest/TemplateController.java | 19 ++- .../cps/tbdmt/rest/TemplateControllerTest.java | 13 ++- cps-tbdmt-service/pom.xml | 4 + .../exception/OutputTransformationException.java | 32 ++++++ .../java/org/onap/cps/tbdmt/model/Template.java | 4 + .../java/org/onap/cps/tbdmt/model/TemplateKey.java | 2 - .../org/onap/cps/tbdmt/model/TemplateRequest.java | 4 + .../cps/tbdmt/service/ExecutionBusinessLogic.java | 128 ++++++++++++++++++++- .../cps/tbdmt/service/TemplateBusinessLogic.java | 7 +- .../onap/cps/tbdmt/client/CpsRestClientTest.java | 1 + .../tbdmt/service/ExecutionBusinessLogicTest.java | 85 +++++++++++++- .../tbdmt/service/TemplateBusinessLogicTest.java | 11 +- .../resources/sample_multiple_query_data_1.json | 26 +++++ .../resources/sample_multiple_query_data_2.json | 8 ++ .../resources/sample_multiple_query_data_3.json | 8 ++ .../resources/sample_transform_query_data.json | 104 +++++++++++++++++ 16 files changed, 420 insertions(+), 36 deletions(-) create mode 100644 cps-tbdmt-service/src/main/java/org/onap/cps/tbdmt/exception/OutputTransformationException.java create mode 100644 cps-tbdmt-service/src/test/resources/sample_multiple_query_data_1.json create mode 100644 cps-tbdmt-service/src/test/resources/sample_multiple_query_data_2.json create mode 100644 cps-tbdmt-service/src/test/resources/sample_multiple_query_data_3.json create mode 100644 cps-tbdmt-service/src/test/resources/sample_transform_query_data.json diff --git a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java index 15efdc5..a17130f 100644 --- a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java +++ b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/rest/TemplateController.java @@ -64,29 +64,26 @@ public class TemplateController { } /** - * Get Template by model and templateId. + * Get Template by templateId. * * @param templateId Id to find the template - * @param model schema set to find the template * @return template */ - @GetMapping(path = "/templates/{model}/{templateId}") - public ResponseEntity