From 48dcb76d2895029d72298b0f81eb0cff71a4ea69 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 5 Jul 2018 10:36:49 -0400 Subject: unlock should always return TargetLock ControlLoopEventManager.unlock only returns the TargetLock if the PolicyGuard.unlock operation is successful. However, if the lock has already expired, then PolicyGuard.unlock will return false, and ControlLoopEventManager.unlock will then return null. As a result, the rules do not retract the TargetLock. (The rules do, however, retract any left-over TargetLock objects during the clean-up phase. Nevertheless, the earlier rules should not have to depend on the clean-up rules to do that.) Modified the code to address this issue. Change-Id: I2e6099a4e3511053d2e6e1373cae4b480798d1b6 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn --- .../policy/controlloop/eventmanager/ControlLoopEventManagerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'controlloop/common/eventmanager/src/test/java/org/onap') diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java index 1af4a312d..02dda2048 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java @@ -768,7 +768,7 @@ public class ControlLoopEventManagerTest { lockLock = manager.lockCurrentOperation(); assertNotNull(lockLock); PolicyGuard.unlockTarget(lockLock.getB()); - assertNull(manager.unlockCurrentOperation()); + assertEquals(lockLock.getB(), manager.unlockCurrentOperation()); clom.startOperation(event); -- cgit 1.2.3-korg