OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / statistics / services / direct / AbstractDirectStatisticsServiceTest.java
index 44081aabebb82c754df2570f1d44f3a8f2c5ee5c..1df959a2cc3e30427da82e1ef3104b02b6de9a34 100755 (executable)
@@ -8,7 +8,8 @@
 
 package org.opendaylight.openflowplugin.impl.statistics.services.direct;
 
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.lenient;
 import static org.mockito.Mockito.when;
 
 import java.math.BigInteger;
@@ -105,25 +106,25 @@ public abstract class AbstractDirectStatisticsServiceTest {
                 .child(Node.class, new NodeKey(new NodeId(NODE_ID)));
 
         convertorManager = ConvertorManagerFactory.createDefaultManager();
-        when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
-        when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
-        when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
+        lenient().when(deviceContext.getDeviceFlowRegistry()).thenReturn(deviceFlowRegistry);
+        lenient().when(deviceContext.getDeviceGroupRegistry()).thenReturn(deviceGroupRegistry);
+        lenient().when(deviceContext.getDeviceMeterRegistry()).thenReturn(deviceMeterRegistry);
         when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
         when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
-        when(deviceContext.getMultiMsgCollector(any())).thenReturn(multiMsgCollector);
-        when(deviceContext.oook()).thenReturn(translatorLibrary);
-        when(deviceContext.getDeviceState()).thenReturn(deviceState);
+        lenient().when(deviceContext.getMultiMsgCollector(any())).thenReturn(multiMsgCollector);
+        lenient().when(deviceContext.oook()).thenReturn(translatorLibrary);
+        lenient().when(deviceContext.getDeviceState()).thenReturn(deviceState);
         when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
         when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeInstanceIdentifier);
-        when(deviceInfo.getNodeId()).thenReturn(new NodeId(NODE_ID));
+        lenient().when(deviceInfo.getNodeId()).thenReturn(new NodeId(NODE_ID));
         when(deviceInfo.getVersion()).thenReturn(OF_VERSION);
         when(deviceInfo.getDatapathId()).thenReturn(DATAPATH_ID);
-        when(getFeaturesOutput.getVersion()).thenReturn(OF_VERSION);
-        when(getFeaturesOutput.getDatapathId()).thenReturn(DATAPATH_ID);
+        lenient().when(getFeaturesOutput.getVersion()).thenReturn(OF_VERSION);
+        lenient().when(getFeaturesOutput.getDatapathId()).thenReturn(DATAPATH_ID);
         when(connectionContext.getFeatures()).thenReturn(features);
-        when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
-        when(features.getVersion()).thenReturn(OF_VERSION);
-        when(features.getDatapathId()).thenReturn(DATAPATH_ID);
+        lenient().when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
+        lenient().when(features.getVersion()).thenReturn(OF_VERSION);
+        lenient().when(features.getDatapathId()).thenReturn(DATAPATH_ID);
         multipartWriterProvider = MultipartWriterProviderFactory.createDefaultProvider(deviceContext);
         setUp();
     }