Update MRI upstreams for Phosphorus
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / translator / FlowRemovedTranslatorTest.java
index 12a8fc89fdc4cfe9dc9a695c8298d2e29e97d1a8..a686ee52320d92edc70e3699a995a4adbb699ae7 100644 (file)
@@ -5,19 +5,17 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.translator;
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.when;
 
-import java.math.BigInteger;
 import java.util.Collections;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
@@ -37,6 +35,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 /**
  * Test of {@link AggregatedFlowStatisticsTranslator}.
@@ -72,6 +74,7 @@ public class FlowRemovedTranslatorTest {
         translator = new FlowRemovedTranslator(convertorManager);
         translatorV10 = new FlowRemovedV10Translator(convertorManager);
 
+        when(deviceInfo.getVersion()).thenReturn(Uint8.ONE);
         when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodeId);
     }
 
@@ -100,15 +103,15 @@ public class FlowRemovedTranslatorTest {
     private org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved
             buildMessage(final boolean isV10) {
         FlowRemovedMessageBuilder builder = new FlowRemovedMessageBuilder()
-                .setCookie(BigInteger.ONE)
+                .setCookie(Uint64.ONE)
                 .setReason(FlowRemovedReason.OFPRRGROUPDELETE)
-                .setPriority(1);
+                .setPriority(Uint16.ONE);
 
         if (isV10) {
             builder.setMatchV10(new MatchV10Builder().setWildcards(flowWildcards).build());
         } else {
             builder.setMatch(new MatchBuilder().setMatchEntry(Collections.emptyList()).build())
-                .setTableId(new TableId(42L));
+                .setTableId(new TableId(Uint32.valueOf(42)));
         }
 
         return builder.build();