From 287e9d464e487ed5ae5fe5250ab960194f179c01 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 5 Apr 2019 09:52:35 -0400 Subject: Flesh out policy deployment REST API Also moved the controller, the provider, and supporting classes to their own dep_undep package. Change-Id: Ifea1c4dd2ecbf93a8f4d45e130830cf9271103d3 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn --- .../test/resources/simpleDeploy/daoPolicyList.json | 10 +++ .../test/resources/simpleDeploy/emptyGroups.json | 3 + .../test/resources/simpleDeploy/emptyRequest.json | 3 + .../resources/simpleDeploy/emptyRequestBase.json | 2 + .../test/resources/simpleDeploy/getGroupDao.json | 84 ++++++++++++++++++++++ .../simpleDeploy/getPolicyReqNullVersion.json | 7 ++ main/src/test/resources/simpleDeploy/groups.json | 25 +++++++ main/src/test/resources/simpleDeploy/policy.json | 6 ++ main/src/test/resources/simpleDeploy/request.json | 8 +++ .../test/resources/simpleDeploy/requestBase.json | 4 ++ .../simpleDeploy/updateGroupReqMultiple.json | 20 ++++++ .../resources/simpleDeploy/upgradeGroupDao.json | 72 +++++++++++++++++++ .../resources/simpleDeploy/upgradeGroupGroup1.json | 40 +++++++++++ .../resources/simpleDeploy/upgradeGroupGroup2.json | 25 +++++++ .../simpleDeploy/upgradeGroupPolicy2.json | 10 +++ .../simpleDeploy/upgradeGroupPolicy3.json | 10 +++ .../simpleDeploy/upgradeGroupPolicy4.json | 10 +++ .../simpleDeploy/upgradeGroup_NoPdpsDao.json | 21 ++++++ .../upgradeGroup_NothingUpdatedDao.json | 25 +++++++ 19 files changed, 385 insertions(+) create mode 100644 main/src/test/resources/simpleDeploy/daoPolicyList.json create mode 100644 main/src/test/resources/simpleDeploy/emptyGroups.json create mode 100644 main/src/test/resources/simpleDeploy/emptyRequest.json create mode 100644 main/src/test/resources/simpleDeploy/emptyRequestBase.json create mode 100644 main/src/test/resources/simpleDeploy/getGroupDao.json create mode 100644 main/src/test/resources/simpleDeploy/getPolicyReqNullVersion.json create mode 100644 main/src/test/resources/simpleDeploy/groups.json create mode 100644 main/src/test/resources/simpleDeploy/policy.json create mode 100644 main/src/test/resources/simpleDeploy/request.json create mode 100644 main/src/test/resources/simpleDeploy/requestBase.json create mode 100644 main/src/test/resources/simpleDeploy/updateGroupReqMultiple.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupDao.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupGroup1.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupGroup2.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupPolicy2.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupPolicy3.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroupPolicy4.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroup_NoPdpsDao.json create mode 100644 main/src/test/resources/simpleDeploy/upgradeGroup_NothingUpdatedDao.json (limited to 'main/src/test/resources') diff --git a/main/src/test/resources/simpleDeploy/daoPolicyList.json b/main/src/test/resources/simpleDeploy/daoPolicyList.json new file mode 100644 index 00000000..93ee9146 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/daoPolicyList.json @@ -0,0 +1,10 @@ +{ + "policies": [ + { + "name": "policyA", + "version": "1.2.3", + "type": "typeA", + "typeVersion": "100.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/emptyGroups.json b/main/src/test/resources/simpleDeploy/emptyGroups.json new file mode 100644 index 00000000..44e05c87 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/emptyGroups.json @@ -0,0 +1,3 @@ +{ + "groups": [] +} diff --git a/main/src/test/resources/simpleDeploy/emptyRequest.json b/main/src/test/resources/simpleDeploy/emptyRequest.json new file mode 100644 index 00000000..4c458a32 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/emptyRequest.json @@ -0,0 +1,3 @@ +{ + "policies": [] +} diff --git a/main/src/test/resources/simpleDeploy/emptyRequestBase.json b/main/src/test/resources/simpleDeploy/emptyRequestBase.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/emptyRequestBase.json @@ -0,0 +1,2 @@ +{ +} diff --git a/main/src/test/resources/simpleDeploy/getGroupDao.json b/main/src/test/resources/simpleDeploy/getGroupDao.json new file mode 100644 index 00000000..2e74d1bf --- /dev/null +++ b/main/src/test/resources/simpleDeploy/getGroupDao.json @@ -0,0 +1,84 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "0.0.0", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ] + } + ] + }, + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ] + } + ] + }, + { + "name": "groupA", + "version": "0.0.1", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ] + } + ] + }, + { + "name": "groupA", + "version": "non-numeric-version", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/getPolicyReqNullVersion.json b/main/src/test/resources/simpleDeploy/getPolicyReqNullVersion.json new file mode 100644 index 00000000..bf2d132b --- /dev/null +++ b/main/src/test/resources/simpleDeploy/getPolicyReqNullVersion.json @@ -0,0 +1,7 @@ +{ + "policies": [ + { + "name": "policyA" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/groups.json b/main/src/test/resources/simpleDeploy/groups.json new file mode 100644 index 00000000..7fd7684b --- /dev/null +++ b/main/src/test/resources/simpleDeploy/groups.json @@ -0,0 +1,25 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ], + "policies": [] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/policy.json b/main/src/test/resources/simpleDeploy/policy.json new file mode 100644 index 00000000..7786aab7 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/policy.json @@ -0,0 +1,6 @@ +{ + "name": "policyA", + "version": "1.2.3", + "type": "typeA", + "typeVersion": "100.2.3" +} diff --git a/main/src/test/resources/simpleDeploy/request.json b/main/src/test/resources/simpleDeploy/request.json new file mode 100644 index 00000000..060637cc --- /dev/null +++ b/main/src/test/resources/simpleDeploy/request.json @@ -0,0 +1,8 @@ +{ + "policies": [ + { + "name": "policyA", + "version": "1.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/requestBase.json b/main/src/test/resources/simpleDeploy/requestBase.json new file mode 100644 index 00000000..67fcdcb6 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/requestBase.json @@ -0,0 +1,4 @@ +{ + "name": "policyA", + "version": "1.2.3" +} diff --git a/main/src/test/resources/simpleDeploy/updateGroupReqMultiple.json b/main/src/test/resources/simpleDeploy/updateGroupReqMultiple.json new file mode 100644 index 00000000..3d4684cc --- /dev/null +++ b/main/src/test/resources/simpleDeploy/updateGroupReqMultiple.json @@ -0,0 +1,20 @@ +{ + "policies": [ + { + "name": "policyA", + "version": "1.2.3" + }, + { + "name": "policyB", + "version": "1.2.3" + }, + { + "name": "policyC", + "version": "1.2.3" + }, + { + "name": "policyD", + "version": "1.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupDao.json b/main/src/test/resources/simpleDeploy/upgradeGroupDao.json new file mode 100644 index 00000000..278b69a6 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupDao.json @@ -0,0 +1,72 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ], + "policies": [] + }, + { + "pdpType": "pdpTypeB", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpB" + } + ], + "policies": [] + }, + { + "pdpType": "pdpTypeC", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpC" + } + ], + "policies": [ + { + "name": "policyA", + "version": "1.2.3", + "type": "typeA", + "typeVersion": "100.2.3" + } + ] + }, + { + "pdpType": "pdpTypeD", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpD" + } + ], + "policies": [] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupGroup1.json b/main/src/test/resources/simpleDeploy/upgradeGroupGroup1.json new file mode 100644 index 00000000..a63eadd9 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupGroup1.json @@ -0,0 +1,40 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpA" + } + ], + "policies": [] + }, + { + "pdpType": "pdpTypeC", + "supportedPolicyTypes": [ + { + "name": "typeC", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpC" + } + ], + "policies": [] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupGroup2.json b/main/src/test/resources/simpleDeploy/upgradeGroupGroup2.json new file mode 100644 index 00000000..d4946579 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupGroup2.json @@ -0,0 +1,25 @@ +{ + "groups": [ + { + "name": "groupB", + "version": "300.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeB", + "supportedPolicyTypes": [ + { + "name": "typeB", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpB" + } + ], + "policies": [] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupPolicy2.json b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy2.json new file mode 100644 index 00000000..3a13d0c3 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy2.json @@ -0,0 +1,10 @@ +{ + "policies": [ + { + "name": "policyB", + "version": "1.2.3", + "type": "typeB", + "typeVersion": "100.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupPolicy3.json b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy3.json new file mode 100644 index 00000000..bf5602ea --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy3.json @@ -0,0 +1,10 @@ +{ + "policies": [ + { + "name": "policyC", + "version": "1.2.3", + "type": "typeC", + "typeVersion": "100.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroupPolicy4.json b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy4.json new file mode 100644 index 00000000..3c0fb72f --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroupPolicy4.json @@ -0,0 +1,10 @@ +{ + "policies": [ + { + "name": "policyD", + "version": "1.2.3", + "type": "typeA", + "typeVersion": "100.2.3" + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroup_NoPdpsDao.json b/main/src/test/resources/simpleDeploy/upgradeGroup_NoPdpsDao.json new file mode 100644 index 00000000..72563d47 --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroup_NoPdpsDao.json @@ -0,0 +1,21 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeA", + "supportedPolicyTypes": [ + { + "name": "typeA", + "version": "100.2.3" + } + ], + "pdpInstances": [], + "policies": [] + } + ] + } + ] +} diff --git a/main/src/test/resources/simpleDeploy/upgradeGroup_NothingUpdatedDao.json b/main/src/test/resources/simpleDeploy/upgradeGroup_NothingUpdatedDao.json new file mode 100644 index 00000000..60d6a68c --- /dev/null +++ b/main/src/test/resources/simpleDeploy/upgradeGroup_NothingUpdatedDao.json @@ -0,0 +1,25 @@ +{ + "groups": [ + { + "name": "groupA", + "version": "200.2.3", + "pdpSubgroups": [ + { + "pdpType": "pdpTypeB", + "supportedPolicyTypes": [ + { + "name": "typeX", + "version": "100.2.3" + } + ], + "pdpInstances": [ + { + "instanceId": "pdpB" + } + ], + "policies": [] + } + ] + } + ] +} -- cgit 1.2.3-korg