import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCase;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.UnpooledByteBufAllocator;
-
public class SetMplsTtlActionDeserializerTest extends AbstractActionDeserializerTest {
@Test
- public void testDeserialize() throws Exception {
+ public void testDeserialize() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short mplsTtl = 10;
writeHeader(in);
in.writeZero(ActionConstants.SET_MPLS_TTL_PADDING);
final Action action = deserializeAction(in);
- assertTrue(SetMplsTtlActionCase.class.isInstance(action));
- assertEquals(mplsTtl, SetMplsTtlActionCase.class.cast(action).getSetMplsTtlAction().getMplsTtl().shortValue());
+ assertTrue(action instanceof SetMplsTtlActionCase);
+ assertEquals(mplsTtl, ((SetMplsTtlActionCase) action).getSetMplsTtlAction().getMplsTtl().shortValue());
assertEquals(0, in.readableBytes());
}