aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2020-09-02 17:19:26 +0100
committera.sreekumar <ajith.sreekumar@bell.ca>2020-09-09 10:18:02 +0100
commit4c5c31eb9a2513af080d60d0f537b8339856150d (patch)
tree79aaf0d50cc261f57ce77f2eeae927c3c264478f /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient
parentd350fd659d716ca0b1678029230cc799cead2056 (diff)
APEX standalone support for ToscaPolicy format
Legacy format support is removed, and Tosca format support is added. Change-Id: I3cfc181ccb5471a5d224c0162af18c1fa0fdbc70 Issue-ID: POLICY-2812 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java13
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json149
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json16
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json139
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json148
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json175
6 files changed, 384 insertions, 256 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
index f704ad3ec..9d4da1cd0 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/java/org/onap/policy/apex/plugins/event/carrier/restclient/RestClientCarrierTechnologyParametersTest.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +43,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyParametersBadList() {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json");
arguments.setRelativeFileRoot(".");
assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments))
@@ -52,7 +53,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyParametersNotKvPairs() {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json");
arguments.setRelativeFileRoot(".");
assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments))
@@ -63,7 +64,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyParametersNulls() {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json");
arguments.setRelativeFileRoot(".");
assertThatThrownBy(() -> new ApexParameterHandler().getParameters(arguments))
@@ -74,7 +75,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyParameterFilterInvalid() {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json");
arguments.setRelativeFileRoot(".");
assertThatCode(() -> {
@@ -87,7 +88,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyParametersOk() throws ParameterException {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json");
arguments.setRelativeFileRoot(".");
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
@@ -110,7 +111,7 @@ public class RestClientCarrierTechnologyParametersTest {
@Test
public void testRestClientCarrierTechnologyHttpCodeFilterOk() throws ParameterException {
ApexCommandLineArguments arguments = new ApexCommandLineArguments();
- arguments.setConfigurationFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json");
+ arguments.setToscaPolicyFilePath("src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json");
arguments.setRelativeFileRoot(".");
ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json
index 490767186..bc1eeeebd 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json
@@ -1,75 +1,102 @@
{
- "engineServiceParameters": {
- "name": "MyApexEngine",
- "version": "0.0.1",
- "id": 45,
- "instanceCount": 4,
- "deploymentPort": 12561,
- "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
- "engineParameters": {
- "executorParameters": {
- "JAVASCRIPT": {
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.policies.apex.Simplecontrolloop": {
+ "type": "onap.policies.native.Apex",
+ "type_version": "1.0.0",
+ "name": "onap.policies.apex.Simplecontrolloop",
+ "version": "1.0.0",
+ "properties": {
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12561,
+ "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
}
- }
- }
- },
- "eventInputParameters": {
- "RestClientConsumer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ }
+ },
+ "eventInputParameters": {
+ "RestClientConsumer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb"],
- ["ccc", "ddd"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb"
+ ],
+ [
+ "ccc",
+ "ddd"
+ ]
],
- "httpCodeFilter" : "*\\.*"
+ "httpCodeFilter": "*\\.*"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientConsumer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ },
+ "RestClientConsumer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb"],
- ["ccc", "ddd"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb"
+ ],
+ [
+ "ccc",
+ "ddd"
+ ]
],
- "httpCodeFilter" : " "
+ "httpCodeFilter": " "
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
+ }
},
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- }
- },
- "eventOutputParameters": {
- "RestClientProducer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientProducer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
+ "eventOutputParameters": {
+ "RestClientProducer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "RestClientProducer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ }
}
+ }
}
- }
-}
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json
index be0729f6c..4ecc60cf4 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderBadList.json
@@ -1,4 +1,14 @@
{
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.policies.apex.Simplecontrolloop": {
+ "type": "onap.policies.native.Apex",
+ "type_version": "1.0.0",
+ "name": "onap.policies.apex.Simplecontrolloop",
+ "version": "1.0.0",
+ "properties": {
"engineServiceParameters": {
"name": "MyApexEngine",
"version": "0.0.1",
@@ -72,3 +82,9 @@
}
}
}
+
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json
index c41ff1cb4..d0421261a 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNotKvPairs.json
@@ -1,73 +1,94 @@
{
- "engineServiceParameters": {
- "name": "MyApexEngine",
- "version": "0.0.1",
- "id": 45,
- "instanceCount": 4,
- "deploymentPort": 12561,
- "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
- "engineParameters": {
- "executorParameters": {
- "JAVASCRIPT": {
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.policies.apex.Simplecontrolloop": {
+ "type": "onap.policies.native.Apex",
+ "type_version": "1.0.0",
+ "name": "onap.policies.apex.Simplecontrolloop",
+ "version": "1.0.0",
+ "properties": {
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12561,
+ "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
}
- }
- }
- },
- "eventInputParameters": {
- "RestClientConsumer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ }
+ },
+ "eventInputParameters": {
+ "RestClientConsumer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb", "ccc"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb",
+ "ccc"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientConsumer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ },
+ "RestClientConsumer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa"]
+ "httpHeaders": [
+ [
+ "aaa"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
+ }
},
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- }
- },
- "eventOutputParameters": {
- "RestClientProducer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientProducer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
+ "eventOutputParameters": {
+ "RestClientProducer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "RestClientProducer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ }
}
+ }
}
- }
-}
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json
index bc9988633..3641adeae 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderNulls.json
@@ -1,73 +1,103 @@
{
- "engineServiceParameters": {
- "name": "MyApexEngine",
- "version": "0.0.1",
- "id": 45,
- "instanceCount": 4,
- "deploymentPort": 12561,
- "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
- "engineParameters": {
- "executorParameters": {
- "JAVASCRIPT": {
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.policies.apex.Simplecontrolloop": {
+ "type": "onap.policies.native.Apex",
+ "type_version": "1.0.0",
+ "name": "onap.policies.apex.Simplecontrolloop",
+ "version": "1.0.0",
+ "properties": {
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12561,
+ "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
}
- }
- }
- },
- "eventInputParameters": {
- "RestClientConsumer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ }
+ },
+ "eventInputParameters": {
+ "RestClientConsumer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- [null, "bbb"],
- ["ccc", "ddd"]
+ "httpHeaders": [
+ [
+ null,
+ "bbb"
+ ],
+ [
+ "ccc",
+ "ddd"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
}
- }
- },
- "RestClientConsumer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ },
+ "RestClientConsumer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb"],
- ["ccc", null],
- ["eee", "fff"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb"
+ ],
+ [
+ "ccc",
+ null
+ ],
+ [
+ "eee",
+ "fff"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
+ }
},
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- }
- },
- "eventOutputParameters": {
- "RestClientProducer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientProducer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
+ "eventOutputParameters": {
+ "RestClientProducer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "RestClientProducer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ }
}
+ }
}
- }
-}
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json
index 3586b4481..aa5ab8493 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test/resources/prodcons/RESTClientWithHTTPHeaderOK.json
@@ -1,91 +1,124 @@
{
- "engineServiceParameters": {
- "name": "MyApexEngine",
- "version": "0.0.1",
- "id": 45,
- "instanceCount": 4,
- "deploymentPort": 12561,
- "policyModelFileName": "src/test/resources/policymodels/RequestorModel.json",
- "engineParameters": {
- "executorParameters": {
- "JAVASCRIPT": {
+ "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.policies.apex.Simplecontrolloop": {
+ "type": "onap.policies.native.Apex",
+ "type_version": "1.0.0",
+ "name": "onap.policies.apex.Simplecontrolloop",
+ "version": "1.0.0",
+ "properties": {
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12561,
+ "policy_type_impl": {
+ "apexPolicyModel": {}
+ },
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
}
- }
- }
- },
- "eventInputParameters": {
- "RestClientConsumer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ }
+ },
+ "eventInputParameters": {
+ "RestClientConsumer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpHeaders": [],
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientConsumer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ },
+ "RestClientConsumer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb"],
- ["ccc", "ddd"],
- ["eee", "fff"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb"
+ ],
+ [
+ "ccc",
+ "ddd"
+ ],
+ [
+ "eee",
+ "fff"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
+ }
},
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- }
- },
- "eventOutputParameters": {
- "RestClientProducer0": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ "eventOutputParameters": {
+ "RestClientProducer0": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpHeaders": [],
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
- }
- },
- "RestClientProducer1": {
- "carrierTechnologyParameters": {
- "carrierTechnology": "RESTCLIENT",
- "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
- "parameters": {
+ },
+ "RestClientProducer1": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
+ "parameters": {
"url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent",
"httpMethod": "GET",
- "httpHeaders" : [
- ["aaa", "bbb"],
- ["ccc", "ddd"],
- ["eee", "fff"]
+ "httpHeaders": [
+ [
+ "aaa",
+ "bbb"
+ ],
+ [
+ "ccc",
+ "ddd"
+ ],
+ [
+ "eee",
+ "fff"
+ ]
],
- "httpCodeFilter" : "[1-5][0][0-5]"
+ "httpCodeFilter": "[1-5][0][0-5]"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
}
- },
- "eventProtocolParameters": {
- "eventProtocol": "JSON"
+ }
}
+ }
}
- }
-}
+ }
+ ]
+ }
+} \ No newline at end of file