OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / applications / forwardingrules-sync / src / test / java / org / opendaylight / openflowplugin / applications / frsync / impl / SyncReactorGuardDecoratorTest.java
index 5b43181d65d6bdedc117abcc9713ecb2d763728e..8724c531747e97796864554b493a7b4ad36c6078 100644 (file)
@@ -12,12 +12,11 @@ import com.google.common.util.concurrent.Futures;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
-import org.opendaylight.openflowplugin.applications.frsync.util.SemaphoreKeeperGuavaImpl;
 import org.opendaylight.openflowplugin.applications.frsync.util.SyncupEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -47,19 +46,19 @@ public class SyncReactorGuardDecoratorTest {
 
     @Before
     public void setUp() throws Exception {
-        final SemaphoreKeeperGuavaImpl semaphoreKeeper = new SemaphoreKeeperGuavaImpl<InstanceIdentifier<FlowCapableNode>>(1, true);
-        reactor = new SyncReactorGuardDecorator(delegate, semaphoreKeeper);
-        InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID));
+        reactor = new SyncReactorGuardDecorator(delegate);
+        InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class)
+                .child(Node.class, new NodeKey(NODE_ID));
         fcNodePath = nodePath.augmentation(FlowCapableNode.class);
 
         final Node operationalNode = Mockito.mock(Node.class);
-        Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
-        Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
+        Mockito.lenient().when(operationalNode.getId()).thenReturn(NODE_ID);
+        Mockito.lenient().when(operationalNode.augmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
     }
 
     @Test
-    public void testSyncupSuccess() throws Exception {
-        Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Matchers.<SyncupEntry>any()))
+    public void testSyncupSuccess() {
+        Mockito.when(delegate.syncup(ArgumentMatchers.any(), ArgumentMatchers.any()))
                 .thenReturn(Futures.immediateFuture(Boolean.TRUE));
 
         reactor.syncup(fcNodePath, syncupEntry);
@@ -69,15 +68,13 @@ public class SyncReactorGuardDecoratorTest {
     }
 
     @Test
-    public void testSyncupFail() throws Exception {
-        Mockito.when(delegate.syncup(Matchers.<InstanceIdentifier<FlowCapableNode>>any(), Matchers.<SyncupEntry>any()))
+    public void testSyncupFail() {
+        Mockito.when(delegate.syncup(ArgumentMatchers.any(), ArgumentMatchers.any()))
                 .thenReturn(Futures.immediateFailedFuture(new Exception()));
 
         reactor.syncup(fcNodePath, syncupEntry);
 
         Mockito.verify(delegate).syncup(fcNodePath, syncupEntry);
         Mockito.verifyNoMoreInteractions(delegate);
-
     }
-
-}
\ No newline at end of file
+}