From 6e55b1d7c3e53fb49c5e94406ff5db4cb9990c87 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Tue, 19 Mar 2019 16:08:58 -0400 Subject: Use Policy Translator abstract class Instead of applications implementing the converter, use a protected abstract class that implements common code. Newer applications could re-use existing application, and shared code can be put into the base translator class. Fixed sonar issue and changed guard xml. Removed Converter and made translator into an implementation class that is an object in the Application Provider. Issue-ID: POLICY-1273 Change-Id: I9b48cbcdaf80d6d2ef19ef53e4b7cd4830e7e7b2 Signed-off-by: Pamela Dragosh --- .../decisions/decision.guard.shoulddeny.input.json | 14 ++++++++++++++ .../decisions/decision.guard.shoulddeny.output.json | 3 +++ .../decisions/decision.guard.shouldpermit.input.json | 14 ++++++++++++++ .../decisions/decision.guard.shouldpermit.output.json | 3 +++ 4 files changed, 34 insertions(+) create mode 100644 main/src/test/resources/decisions/decision.guard.shoulddeny.input.json create mode 100644 main/src/test/resources/decisions/decision.guard.shoulddeny.output.json create mode 100644 main/src/test/resources/decisions/decision.guard.shouldpermit.input.json create mode 100644 main/src/test/resources/decisions/decision.guard.shouldpermit.output.json (limited to 'main/src/test/resources') diff --git a/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json b/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json new file mode 100644 index 00000000..ba9b5543 --- /dev/null +++ b/main/src/test/resources/decisions/decision.guard.shoulddeny.input.json @@ -0,0 +1,14 @@ +{ + "ONAPName": "Policy", + "ONAPComponent": "DCAE", + "ONAPInstance": "optional-tbd", + "action": "guard", + "resource": { + "guard": { + "actor": "SO", + "recipe": "scaleOut", + "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "vfcount" : "5" + } + } +} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json b/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json new file mode 100644 index 00000000..3752fe47 --- /dev/null +++ b/main/src/test/resources/decisions/decision.guard.shoulddeny.output.json @@ -0,0 +1,3 @@ +{ + "status": "deny" +} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json b/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json new file mode 100644 index 00000000..324d495a --- /dev/null +++ b/main/src/test/resources/decisions/decision.guard.shouldpermit.input.json @@ -0,0 +1,14 @@ +{ + "ONAPName": "Policy", + "ONAPComponent": "DCAE", + "ONAPInstance": "optional-tbd", + "action": "guard", + "resource": { + "guard": { + "actor": "SO", + "recipe": "scaleOut", + "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "vfcount" : "1" + } + } +} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json b/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json new file mode 100644 index 00000000..a1939262 --- /dev/null +++ b/main/src/test/resources/decisions/decision.guard.shouldpermit.output.json @@ -0,0 +1,3 @@ +{ + "status": "permit" +} \ No newline at end of file -- cgit 1.2.3-korg