OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / statistics / services / dedicated / StatisticsGatheringOnTheFlyServiceTest.java
index eb17d48ae775499080e9c194199cc91b54c3bacd..ab50f4030cc73b5a082b71723f47a88bcc92f5c5 100644 (file)
@@ -13,9 +13,13 @@ import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.openflowplugin.api.openflow.device.Xid;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier;
+import org.opendaylight.openflowplugin.impl.datastore.MultipartWriterProviderFactory;
 import org.opendaylight.openflowplugin.impl.services.ServiceMocking;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 
@@ -25,12 +29,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 public class StatisticsGatheringOnTheFlyServiceTest extends ServiceMocking {
 
     public static final NodeId NODE_ID = new NodeId(DUMMY_NODE_ID);
-    private StatisticsGatheringOnTheFlyService statisticsGatheringService;
+    private StatisticsGatheringOnTheFlyService<MultipartReply> statisticsGatheringService;
 
     @Override
     protected void setup() {
-        statisticsGatheringService = new StatisticsGatheringOnTheFlyService(mockedRequestContextStack, mockedDeviceContext);
-        Mockito.doReturn(NODE_ID).when(mockedPrimConnectionContext).getNodeId();
+        final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
+        statisticsGatheringService =
+                new StatisticsGatheringOnTheFlyService<>(mockedRequestContextStack,
+                                                         mockedDeviceContext,
+                                                         convertorManager,
+                                                         MultipartWriterProviderFactory
+                                                                 .createDefaultProvider(mockedDeviceContext));
         Mockito.when(mockedDeviceInfo.getNodeId()).thenReturn(NODE_ID);
         Mockito.when(mockedDeviceContext.getDeviceInfo().getNodeId()).thenReturn(NODE_ID);
     }
@@ -51,4 +60,4 @@ public class StatisticsGatheringOnTheFlyServiceTest extends ServiceMocking {
         Assert.assertEquals(xidValue, request.getXid().longValue());
         Assert.assertNotNull(request);
     }
-}
\ No newline at end of file
+}