diff options
author | Jim Hahn <jrh3@att.com> | 2020-06-29 17:43:07 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-06-29 17:44:28 -0400 |
commit | c2e0698897c060a91a5212f8f42d8aa2a9b96e65 (patch) | |
tree | 62dc0d58d1f4a4350e96ad24159882ecd0aed445 /controlloop/common/eventmanager/src/test | |
parent | 5814190df5c082e5b681baf336f9e45ba88c3658 (diff) |
Fix build breakage in drools-apps due to pair
The Pair changes made in drools-pdp also broke drools-apps builds.
Replaced usage of drools.utils.Pair with apache Pair.
Issue-ID: POLICY-2202
Change-Id: I50aaad47c243637688602ae6cb680a929fe3edd9
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/test')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java | 36 |
1 files changed, 18 insertions, 18 deletions
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 2d9fb7e1d..7479f66b1 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 @@ -46,6 +46,7 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; import org.junit.AfterClass; import org.junit.Before; @@ -66,7 +67,6 @@ import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.drools.core.lock.Lock; import org.onap.policy.drools.core.lock.LockCallback; import org.onap.policy.drools.system.PolicyEngineConstants; -import org.onap.policy.drools.utils.Pair; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.powermock.reflect.Whitebox; @@ -454,15 +454,15 @@ public class ControlLoopEventManagerTest { assertNull(clom.getOperationResult()); Pair<Lock, Lock> lockPair = manager.lockCurrentOperation(callback); - assertNull(lockPair.first()); - assertNotNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNotNull(lockPair.getRight()); // pseudo lock - session should NOT have been notified of the change verify(callback, never()).lockAvailable(any()); verify(callback, never()).lockUnavailable(any()); // repeat - should cause an extension - Lock lock = lockPair.second(); + Lock lock = lockPair.getRight(); lockPair = manager.lockCurrentOperation(callback); /* @@ -474,20 +474,20 @@ public class ControlLoopEventManagerTest { assertSame(lock, manager.unlockCurrentOperation()); - assertNull(lockPair.first()); - assertNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNull(lockPair.getRight()); // force it to use a pseudo lock manager.setUseTargetLock(false); lockPair = manager.lockCurrentOperation(callback); - assertNull(lockPair.first()); - assertNotNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNotNull(lockPair.getRight()); - lock = lockPair.second(); + lock = lockPair.getRight(); lockPair = manager.lockCurrentOperation(callback); - assertNull(lockPair.first()); - assertNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNull(lockPair.getRight()); // first lock uses a pseudo lock, so it will only update when extended verify(callback).lockAvailable(lock); @@ -498,14 +498,14 @@ public class ControlLoopEventManagerTest { Whitebox.setInternalState(manager, TARGET_LOCK_FIELD, lock); lockPair = manager.lockCurrentOperation(callback); - assertSame(lock, lockPair.first()); - assertNotNull(lockPair.second()); + assertSame(lock, lockPair.getLeft()); + assertNotNull(lockPair.getRight()); - lock = lockPair.second(); + lock = lockPair.getRight(); lockPair = manager.lockCurrentOperation(callback); - assertNull(lockPair.first()); - assertNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNull(lockPair.getRight()); // first lock uses a pseudo lock, so it won't do an update verify(callback).lockAvailable(lock); @@ -515,8 +515,8 @@ public class ControlLoopEventManagerTest { // try again - this time don't return the fact handle- no change in count lockPair = manager.lockCurrentOperation(callback); - assertNull(lockPair.first()); - assertNotNull(lockPair.second()); + assertNull(lockPair.getLeft()); + assertNotNull(lockPair.getRight()); } @Test |