Migrate openflow-protocol-impl tests to Uint types
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / RoleReplyMessageFactoryTest.java
index d23e8e17cc678693056f471752f54896d19b9788..b66f310ee04a16ab205626a3fb53a4eed53becb1 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ControllerRole;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutputBuilder;
+import org.opendaylight.yangtools.yang.common.Uint64;
 
 /**
  * Unit tests for RoleReplyMessageFactory.
@@ -46,7 +47,7 @@ public class RoleReplyMessageFactoryTest {
         RoleRequestOutputBuilder builder = new RoleRequestOutputBuilder();
         BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
         builder.setRole(ControllerRole.forValue(0));
-        builder.setGenerationId(BigInteger.valueOf(1L));
+        builder.setGenerationId(Uint64.ONE);
         RoleRequestOutput message = builder.build();
 
         ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
@@ -55,8 +56,8 @@ public class RoleReplyMessageFactoryTest {
         Assert.assertEquals("Wrong role", message.getRole().getIntValue(),
                 ControllerRole.forValue((int) serializedBuffer.readUnsignedInt()).getIntValue());
         serializedBuffer.skipBytes(PADDING);
-        byte[] genId = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
+        byte[] genId = new byte[Long.BYTES];
         serializedBuffer.readBytes(genId);
-        Assert.assertEquals("Wrong generation ID", message.getGenerationId(), new BigInteger(1, genId));
+        Assert.assertEquals("Wrong generation ID", message.getGenerationId(), Uint64.valueOf(new BigInteger(1, genId)));
     }
 }