diff options
author | ramverma <ram.krishna.verma@ericsson.com> | 2018-08-17 20:38:03 +0100 |
---|---|---|
committer | ramverma <ram.krishna.verma@ericsson.com> | 2018-08-22 13:33:36 +0100 |
commit | 7de549e5589d5e98a798e65752396627f6990fe1 (patch) | |
tree | 95ebd6d2d1cd9694f139c03cd4d6df31d1bc3e8d /main/src/test/resources | |
parent | 742c4b2ed82860e2a74f3db3b2048173fbc530d8 (diff) |
Adding health check endpoint to distribution
* Adding health check REST endpoint to distribution service.
* Adding isAlive field to DistributionActivator to fetch the health
status.
* Adding parameter group for rest server parameters.
* Adding DistributionRestController for hosting all the rest endpoints
in distribution service.
* Adding DistributionRestServer to manage lifecycle of distribution rest server.
* Adding ParameterValidationUtils utility class for common validations.
Plan is to move this class to policy-common for wider use later.
* Adding test cases for all new code added.
* Refering common classes from policy/common
Change-Id: I246d57133ed1f0c3548bcdee173d7b64fb368abc
Issue-ID: POLICY-1035
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'main/src/test/resources')
20 files changed, 309 insertions, 1 deletions
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters.json index bcf8b263..7ebab314 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json index a53dc05f..940f9018 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json index b88fda2a..b596f064 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json index 45368be1..74733007 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ } }
\ No newline at end of file diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json index aae53f50..f31a396b 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json @@ -1,5 +1,11 @@ { "name":" ", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json index c1ad0a9e..cc43e378 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json index 26f470ea..c4c73eea 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json index a194e958..899fccab 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json index 895e7d55..5e262c05 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json index a368a5b6..4ff308c2 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json index bf0db3e6..a6be01ee 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":" ", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerHost.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerHost.json new file mode 100644 index 00000000..b59074d2 --- /dev/null +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerHost.json @@ -0,0 +1,53 @@ +{ + "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, + "receptionHandlerParameters":{ + "SDCReceptionHandler":{ + "receptionHandlerType":"SDC", + "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler", + "pssdConfiguration":{ + "asdcAddress": "localhost", + "messageBusAddress": [ + "a.com", + "b.com", + "c.com" + ], + "user": "tbdsdc-1480", + "password": "tbdsdc-1480", + "pollingInterval":20, + "pollingTimeout":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT" + ], + "consumerGroup": "policy-group", + "environmentName": "environmentName", + "keystorePath": "null", + "keystorePassword": "null", + "activeserverTlsAuth": false, + "isFilterinEmptyResources": true, + "isUseHttpsWithDmaap": false + }, + "pluginHandlerParameters":{ + "policyDecoders":{ + "TOSCADecoder":{ + "decoderType":"TOSCA", + "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx" + } + }, + "policyForwarders":{ + "PAPEngineForwarder":{ + "forwarderType":"PAPEngine", + "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder" + } + } + } + } + } +} diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPassword.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPassword.json new file mode 100644 index 00000000..7161dee3 --- /dev/null +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPassword.json @@ -0,0 +1,53 @@ +{ + "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"" + }, + "receptionHandlerParameters":{ + "SDCReceptionHandler":{ + "receptionHandlerType":"SDC", + "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler", + "pssdConfiguration":{ + "asdcAddress": "localhost", + "messageBusAddress": [ + "a.com", + "b.com", + "c.com" + ], + "user": "tbdsdc-1480", + "password": "tbdsdc-1480", + "pollingInterval":20, + "pollingTimeout":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT" + ], + "consumerGroup": "policy-group", + "environmentName": "environmentName", + "keystorePath": "null", + "keystorePassword": "null", + "activeserverTlsAuth": false, + "isFilterinEmptyResources": true, + "isUseHttpsWithDmaap": false + }, + "pluginHandlerParameters":{ + "policyDecoders":{ + "TOSCADecoder":{ + "decoderType":"TOSCA", + "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx" + } + }, + "policyForwarders":{ + "PAPEngineForwarder":{ + "forwarderType":"PAPEngine", + "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder" + } + } + } + } + } +} diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPort.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPort.json new file mode 100644 index 00000000..aa480745 --- /dev/null +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerPort.json @@ -0,0 +1,53 @@ +{ + "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":-1, + "userName":"healthcheck", + "password":"zb!XztG34" + }, + "receptionHandlerParameters":{ + "SDCReceptionHandler":{ + "receptionHandlerType":"SDC", + "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler", + "pssdConfiguration":{ + "asdcAddress": "localhost", + "messageBusAddress": [ + "a.com", + "b.com", + "c.com" + ], + "user": "tbdsdc-1480", + "password": "tbdsdc-1480", + "pollingInterval":20, + "pollingTimeout":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT" + ], + "consumerGroup": "policy-group", + "environmentName": "environmentName", + "keystorePath": "null", + "keystorePassword": "null", + "activeserverTlsAuth": false, + "isFilterinEmptyResources": true, + "isUseHttpsWithDmaap": false + }, + "pluginHandlerParameters":{ + "policyDecoders":{ + "TOSCADecoder":{ + "decoderType":"TOSCA", + "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx" + } + }, + "policyForwarders":{ + "PAPEngineForwarder":{ + "forwarderType":"PAPEngine", + "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder" + } + } + } + } + } +} diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerUser.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerUser.json new file mode 100644 index 00000000..d58c035b --- /dev/null +++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerUser.json @@ -0,0 +1,53 @@ +{ + "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"", + "password":"zb!XztG34" + }, + "receptionHandlerParameters":{ + "SDCReceptionHandler":{ + "receptionHandlerType":"SDC", + "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler", + "pssdConfiguration":{ + "asdcAddress": "localhost", + "messageBusAddress": [ + "a.com", + "b.com", + "c.com" + ], + "user": "tbdsdc-1480", + "password": "tbdsdc-1480", + "pollingInterval":20, + "pollingTimeout":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT" + ], + "consumerGroup": "policy-group", + "environmentName": "environmentName", + "keystorePath": "null", + "keystorePassword": "null", + "activeserverTlsAuth": false, + "isFilterinEmptyResources": true, + "isUseHttpsWithDmaap": false + }, + "pluginHandlerParameters":{ + "policyDecoders":{ + "TOSCADecoder":{ + "decoderType":"TOSCA", + "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx" + } + }, + "policyForwarders":{ + "PAPEngineForwarder":{ + "forwarderType":"PAPEngine", + "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder" + } + } + } + } + } +} diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json index 06d18674..530a86d8 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json index d8343b19..6b6d6771 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json index 8b0997ca..b91e95d8 100644 --- a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json +++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json @@ -1,3 +1,9 @@ { - "name":"SDCDistributionGroup" + "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + } }
\ No newline at end of file diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json index 18cd529c..95359b88 100644 --- a/main/src/test/resources/parameters/MinimumParameters.json +++ b/main/src/test/resources/parameters/MinimumParameters.json @@ -1,5 +1,11 @@ { "name":"SDCDistributionGroup", + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + }, "receptionHandlerParameters":{ "SDCReceptionHandler":{ "receptionHandlerType":"SDC", diff --git a/main/src/test/resources/parameters/NoParameters.json b/main/src/test/resources/parameters/NoParameters.json index 7a73a41b..6b0805d3 100644 --- a/main/src/test/resources/parameters/NoParameters.json +++ b/main/src/test/resources/parameters/NoParameters.json @@ -1,2 +1,8 @@ { + "restServerParameters":{ + "host":"0.0.0.0", + "port":6969, + "userName":"healthcheck", + "password":"zb!XztG34" + } }
\ No newline at end of file |