aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/resources
diff options
context:
space:
mode:
authorMichael Mokry <michael.mokry@att.com>2019-01-31 13:16:55 -0600
committerMichael Mokry <michael.mokry@att.com>2019-02-11 15:49:48 -0600
commitf239a66e5dd52f4f0149a307789909c5ffc2b704 (patch)
tree55fdf3342245fcf3feff3e5ef3617424d4468173 /main/src/test/resources
parentbf593eca637e1c3cfa4ece0e0c3d13bcf613b187 (diff)
PDPX Healthcheck/Statistic RESTful API entry point
Includes: - Basic code structure modeled after policy distribution - Code implementation to support Healthcheck/Statistics RESTful API entry point - JUnits - Fixed Checkstyles issues and added some missing statistics classes and Junits - Made changes per Jim's comments - Made more changes per Jim's comments > made gson field static > using AssertThatThrownBy() mechanic from AssertJ > added setup and teardown to correctly terminate activator in Junit - Made corrections to the statitics endpoint and junits Change-Id: Iad40272beceff8a0f99966440e96a84fc2043b12 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>
Diffstat (limited to 'main/src/test/resources')
-rw-r--r--main/src/test/resources/expectedValidationResults/InvalidRestServerParameters.txt7
-rw-r--r--main/src/test/resources/parameters/BadParameters.json3
-rw-r--r--main/src/test/resources/parameters/EmptyParameters.json0
-rw-r--r--main/src/test/resources/parameters/InvalidParameters.json3
-rw-r--r--main/src/test/resources/parameters/MinimumParameters.json9
-rw-r--r--main/src/test/resources/parameters/NoParameters.json8
-rw-r--r--main/src/test/resources/parameters/XacmlPdpConfigParameters.json9
-rw-r--r--main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidName.json9
-rw-r--r--main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json9
9 files changed, 57 insertions, 0 deletions
diff --git a/main/src/test/resources/expectedValidationResults/InvalidRestServerParameters.txt b/main/src/test/resources/expectedValidationResults/InvalidRestServerParameters.txt
new file mode 100644
index 00000000..957da6d6
--- /dev/null
+++ b/main/src/test/resources/expectedValidationResults/InvalidRestServerParameters.txt
@@ -0,0 +1,7 @@
+validation error(s) on parameters from "parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json"
+parameter group "XacmlPdpGroup" type "org.onap.policy.pdpx.main.parameters.XacmlPdpParameterGroup" INVALID, parameter group has status INVALID
+ parameter group "null" type "org.onap.policy.pdpx.main.parameters.RestServerParameters" INVALID, parameter group has status INVALID
+ field "host" type "java.lang.String" value "" INVALID, must be a non-blank string containing hostname/ipaddress of the xacml pdp rest server
+ field "port" type "int" value "-1" INVALID, must be a positive integer containing port of the xacml pdp rest server
+ field "userName" type "java.lang.String" value "" INVALID, must be a non-blank string containing userName for xacml pdp rest server credentials
+ field "password" type "java.lang.String" value "" INVALID, must be a non-blank string containing password for xacml pdp rest server credentials
diff --git a/main/src/test/resources/parameters/BadParameters.json b/main/src/test/resources/parameters/BadParameters.json
new file mode 100644
index 00000000..f2abd509
--- /dev/null
+++ b/main/src/test/resources/parameters/BadParameters.json
@@ -0,0 +1,3 @@
+{
+ "name": []
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/EmptyParameters.json b/main/src/test/resources/parameters/EmptyParameters.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/main/src/test/resources/parameters/EmptyParameters.json
diff --git a/main/src/test/resources/parameters/InvalidParameters.json b/main/src/test/resources/parameters/InvalidParameters.json
new file mode 100644
index 00000000..f2abd509
--- /dev/null
+++ b/main/src/test/resources/parameters/InvalidParameters.json
@@ -0,0 +1,3 @@
+{
+ "name": []
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json
new file mode 100644
index 00000000..798731ae
--- /dev/null
+++ b/main/src/test/resources/parameters/MinimumParameters.json
@@ -0,0 +1,9 @@
+{
+ "name": "XacmlPdpGroup",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34"
+ }
+}
diff --git a/main/src/test/resources/parameters/NoParameters.json b/main/src/test/resources/parameters/NoParameters.json
new file mode 100644
index 00000000..bbe1ee13
--- /dev/null
+++ b/main/src/test/resources/parameters/NoParameters.json
@@ -0,0 +1,8 @@
+{
+ "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/XacmlPdpConfigParameters.json b/main/src/test/resources/parameters/XacmlPdpConfigParameters.json
new file mode 100644
index 00000000..798731ae
--- /dev/null
+++ b/main/src/test/resources/parameters/XacmlPdpConfigParameters.json
@@ -0,0 +1,9 @@
+{
+ "name": "XacmlPdpGroup",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34"
+ }
+}
diff --git a/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidName.json b/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidName.json
new file mode 100644
index 00000000..8949a3c4
--- /dev/null
+++ b/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidName.json
@@ -0,0 +1,9 @@
+{
+ "name": " ",
+ "restServerParameters": {
+ "host": "0.0.0.0",
+ "port": 6969,
+ "userName": "healthcheck",
+ "password": "zb!XztG34"
+ }
+}
diff --git a/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json b/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json
new file mode 100644
index 00000000..8b8e5c67
--- /dev/null
+++ b/main/src/test/resources/parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json
@@ -0,0 +1,9 @@
+{
+ "name": "XacmlPdpGroup",
+ "restServerParameters": {
+ "host": "",
+ "port": -1,
+ "userName": "",
+ "password": ""
+ }
+}