diff options
author | a.sreekumar <ajith.sreekumar@est.tech> | 2020-02-25 16:49:33 +0000 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@est.tech> | 2020-02-27 09:50:48 +0000 |
commit | 6ddf46e995be34cc03d92a41948e14dfc5c9f4f9 (patch) | |
tree | 505ca1d25eba0bf62635a10e0eebd0d4449178a6 /testsuites/integration/integration-uservice-test/src/test/resources/testdata | |
parent | aacc7442f046d44359934ea3d93f425a809e7616 (diff) |
Add integration tests for Parameter passing in APEX
Change-Id: I5d01766ffb0104f632bebc9b553e7dca83b4829f
Issue-ID: POLICY-2364
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Diffstat (limited to 'testsuites/integration/integration-uservice-test/src/test/resources/testdata')
3 files changed, 262 insertions, 0 deletions
diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_invalidTaskIds.json b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_invalidTaskIds.json new file mode 100644 index 000000000..0714f4b37 --- /dev/null +++ b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_invalidTaskIds.json @@ -0,0 +1,88 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "target/TaskParametersTestPolicyModel.json", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + }, + "taskParameters": [ + { + "key": "serviceId", + "value": "serviceId123", + "taskId": "InvalidTaskId:1.0.0" + }, + { + "key": "closedLoopId", + "value": "closedLoopId123", + "taskId": "InvalidTaskIdForCLOutTask" + } + ] + } }, + "eventInputParameters": { + "GetCodeConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/event/GetEvent", + "httpMethod": "GET" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "CLTriggerEvent" + }, + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/service/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstProducer" + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstConsumer" + }, + "SecondProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/action/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "CLOutputEvent" + } + } +} diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_noTaskIds.json b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_noTaskIds.json new file mode 100644 index 000000000..217d6bda2 --- /dev/null +++ b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_noTaskIds.json @@ -0,0 +1,86 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "target/TaskParametersTestPolicyModel.json", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + }, + "taskParameters": [ + { + "key": "serviceId", + "value": "serviceId123" + }, + { + "key": "closedLoopId", + "value": "closedLoopId123" + } + ] + } }, + "eventInputParameters": { + "GetCodeConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/event/GetEvent", + "httpMethod": "GET" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "CLTriggerEvent" + }, + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/service/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstProducer" + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstConsumer" + }, + "SecondProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/action/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "CLOutputEvent" + } + } +} diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_validTaskIds.json b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_validTaskIds.json new file mode 100644 index 000000000..0029374f9 --- /dev/null +++ b/testsuites/integration/integration-uservice-test/src/test/resources/testdata/taskparameters/TaskParameterTestConfig_with_validTaskIds.json @@ -0,0 +1,88 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 1, + "deploymentPort": 12561, + "policyModelFileName": "target/TaskParametersTestPolicyModel.json", + "engineParameters": { + "executorParameters": { + "JAVASCRIPT": { + "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" + } + }, + "taskParameters": [ + { + "key": "serviceId", + "value": "serviceIdxyz", + "taskId": "SetServiceIdForTest:1.0.0" + }, + { + "key": "closedLoopId", + "value": "closedLoopIdxyz", + "taskId": "SetControlLoopNameForTest:1.0.0" + } + ] + } }, + "eventInputParameters": { + "GetCodeConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/event/GetEvent", + "httpMethod": "GET" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "CLTriggerEvent" + }, + "FirstConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/service/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstProducer" + } + }, + "eventOutputParameters": { + "FirstProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ServiceInfoEvent", + "requestorMode": true, + "requestorPeer": "FirstConsumer" + }, + "SecondProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestTaskParametersRest/apex/action/{tagId}/{value}", + "httpMethod": "POST" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "CLOutputEvent" + } + } +} |