diff options
author | 2019-07-12 15:49:30 +0000 | |
---|---|---|
committer | 2019-07-12 15:49:30 +0000 | |
commit | 9e4e4474ee079176b26ed0af7105a4b23540d585 (patch) | |
tree | 80d7ad4b1172447a7703af4f27fd2b7ed5293548 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources | |
parent | 8916bd3e643daeba1b09f6b04f831ac92962537d (diff) |
add status filter in restclient and restrequestor
Issue-ID: POLICY-1742
Change-Id: Ib4984b18c0353cddb12c13c352277728be691bf5
Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources')
5 files changed, 106 insertions, 8 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json new file mode 100644 index 000000000..d7a076346 --- /dev/null +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTClientWithHTTPFilterInvalid.json @@ -0,0 +1,90 @@ +{ + "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": { + "RestRequestorConsumer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent", + "httpMethod": "GET", + "httpHeaders" : [ + ], + "httpCodeFilter" : "*\\.*" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ResponseEvent", + "requestorMode": true, + "requestorPeer": "RestRequestorProducer0", + "requestorTimeout": 2000 + }, + "RestRequestorConsumer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent", + "httpMethod": "GET", + "httpHeaders" : [ + ["aaa", "bbb"], + ["ccc", "ddd"], + ["eee", "fff"] + ], + "httpCodeFilter" : " " + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "ResponseEvent", + "requestorMode": true, + "requestorPeer": "RestRequestorProducer1", + "requestorTimeout": 2000 + } + }, + "eventOutputParameters": { + "RestRequestorProducer0": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "RequestEvent", + "requestorMode": true, + "requestorPeer": "RestRequestorConsumer0", + "requestorTimeout": 2000 + }, + "RestRequestorProducer1": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "RequestEvent", + "requestorMode": true, + "requestorPeer": "RestRequestorConsumer1", + "requestorTimeout": 2000 + } + } +} diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderBadList.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderBadList.json index ffe04422b..5fbee4404 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderBadList.json +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderBadList.json @@ -25,7 +25,8 @@ "httpHeaders" : [ ["aaa", "bbb"], ["ccc", "ddd"], - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { @@ -45,7 +46,8 @@ "httpMethod": "GET", "httpHeaders" : [ , - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNotKvPairs.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNotKvPairs.json index c1a195b43..f3fbab801 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNotKvPairs.json +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNotKvPairs.json @@ -24,7 +24,8 @@ "httpMethod": "GET", "httpHeaders" : [ ["aaa", "bbb", "ccc"] - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { @@ -44,7 +45,8 @@ "httpMethod": "GET", "httpHeaders" : [ ["aaa"] - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNulls.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNulls.json index dd0484e8e..26059be00 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNulls.json +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderNulls.json @@ -25,7 +25,8 @@ "httpHeaders" : [ [null, "bbb"], ["ccc", "ddd"] - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { @@ -47,7 +48,8 @@ ["aaa", "bbb"], ["ccc", null], ["eee", "fff"] - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderOK.json b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderOK.json index 504c77379..d1dc7d403 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderOK.json +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/RESTRequestorWithHTTPHeaderOK.json @@ -23,7 +23,8 @@ "url": "http://localhost:32801/TestRESTRequestor/apex/event/GetEvent", "httpMethod": "GET", "httpHeaders" : [ - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { @@ -45,7 +46,8 @@ ["aaa", "bbb"], ["ccc", "ddd"], ["eee", "fff"] - ] + ], + "httpCodeFilter" : "[1-5][0][0-5]" } }, "eventProtocolParameters": { |