summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/test')
-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