From 8a1bd0d8ee600ffe06b9a832a876d8a9f58f2f8c Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 6 Feb 2018 14:17:36 +0000 Subject: Add JUnit and Remove Technical Debt in Guard Unit test for guard added and technical debt removed. Issue-ID: POLICY-455 Change-Id: I440766660ddae078013e21b1991ee49c8e488bb3 Signed-off-by: liamfallon --- .../src/main/resources/__closedLoopControlName__.drl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'controlloop/templates') diff --git a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl index c09e64abe..bdb57697b 100644 --- a/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +++ b/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl @@ -677,8 +677,8 @@ rule "${policyName}.GUARD.RESPONSE" //we will permit the operation if there was no Guard for it - if("Indeterminate".equalsIgnoreCase($guardResponse.result)){ - $guardResponse.result = "Permit"; + if("Indeterminate".equalsIgnoreCase($guardResponse.getResult())){ + $guardResponse.setResult("Permit"); } // @@ -686,7 +686,7 @@ rule "${policyName}.GUARD.RESPONSE" // VirtualControlLoopNotification notification = new VirtualControlLoopNotification($event); notification.setNotification(ControlLoopNotificationType.OPERATION); - notification.setMessage("Guard result for " + $operation.policy.getActor() + " " + $operation.policy.getRecipe() + " is " + $guardResponse.result); + notification.setMessage("Guard result for " + $operation.policy.getActor() + " " + $operation.policy.getRecipe() + " is " + $guardResponse.getResult()); notification.setHistory($operation.getHistory()); notification.setFrom("policy"); notification.setPolicyName(drools.getRule().getName()); @@ -695,9 +695,9 @@ rule "${policyName}.GUARD.RESPONSE" PolicyEngine.manager.deliver("POLICY-CL-MGT", notification); - if("Permit".equalsIgnoreCase($guardResponse.result)){ + if("Permit".equalsIgnoreCase($guardResponse.getResult())){ - modify($operation){setGuardApprovalStatus($guardResponse.result)}; + modify($operation){setGuardApprovalStatus($guardResponse.getResult())}; } else { //This is the Deny case -- cgit 1.2.3-korg