Update MRI projects for Aluminium
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / instruction / WriteActionsInstructionDeserializerTest.java
index 8998a1c34764ca43af1e7aa6d6522c5f19d951fa..be39ff50bafa2fc46469748ed1b04800c55d3012 100644 (file)
@@ -10,6 +10,8 @@ package org.opendaylight.openflowplugin.impl.protocol.deserialization.instructio
 
 import static org.junit.Assert.assertEquals;
 
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.UnpooledByteBufAllocator;
 import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
@@ -21,23 +23,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteActionsCase;
 
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.UnpooledByteBufAllocator;
-
 public class WriteActionsInstructionDeserializerTest extends AbstractInstructionDeserializerTest {
 
     private OFDeserializer<Instruction> deserializer;
 
     @Override
+    @SuppressWarnings("checkstyle:LineLength")
     protected void init() {
         deserializer = getRegistry().getDeserializer(
                 new MessageCodeActionExperimenterKey(EncodeConstants.OF13_VERSION_ID, getType(), Instruction.class,
-                    ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
-                    null));
+                        ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS,
+                        null));
     }
 
     @Test
-    public void testDeserialize() throws Exception {
+    public void testDeserialize() {
         final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
 
         // Header
@@ -55,11 +55,11 @@ public class WriteActionsInstructionDeserializerTest extends AbstractInstruction
         in.setShort(index, in.writerIndex() - startIndex);
 
         final Instruction instruction = deserializer.deserialize(in);
-        assertEquals(WriteActionsCase.class, instruction.getImplementedInterface());
-        final WriteActionsCase actionCase = WriteActionsCase.class.cast(instruction);
+        assertEquals(WriteActionsCase.class, instruction.implementedInterface());
+        final WriteActionsCase actionCase = (WriteActionsCase) instruction;
         assertEquals(1, actionCase.getWriteActions().getAction().size());
-        assertEquals(PopPbbActionCase.class, actionCase.getWriteActions().getAction().get(0)
-                .getAction().getImplementedInterface());
+        assertEquals(PopPbbActionCase.class, actionCase.getWriteActions().nonnullAction().values().iterator().next()
+                .getAction().implementedInterface());
         assertEquals(0, in.readableBytes());
     }