Update MRI projects for Aluminium
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / multipart / MultipartReplyMessageDeserializerTest.java
index 8a401ffda4a04b746d2d8e3ea01b07b8ed0097ce..eb2bc28cb4fcb7a093bafb90a3100148155e067a 100644 (file)
@@ -64,7 +64,7 @@ public class MultipartReplyMessageDeserializerTest extends AbstractDeserializerT
     }
 
     @Test
-    public void deserialize() throws Exception {
+    public void deserialize() {
         ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
         buffer.writeByte(TYPE);
         buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -134,7 +134,8 @@ public class MultipartReplyMessageDeserializerTest extends AbstractDeserializerT
         final MultipartReplyFlowStats reply = (MultipartReplyFlowStats) message.getMultipartReplyBody();
 
         assertEquals(XID, message.getXid().intValue());
-        final FlowAndStatisticsMapList flowAndStatisticsMapList = reply.getFlowAndStatisticsMapList().get(0);
+        final FlowAndStatisticsMapList flowAndStatisticsMapList =
+                reply.nonnullFlowAndStatisticsMapList().values().iterator().next();
         assertEquals(TABLE_ID, flowAndStatisticsMapList.getTableId().shortValue());
         assertEquals(SECOND, flowAndStatisticsMapList.getDuration().getSecond().getValue().intValue());
         assertEquals(NANOSECOND, flowAndStatisticsMapList.getDuration().getNanosecond().getValue().intValue());
@@ -148,12 +149,14 @@ public class MultipartReplyMessageDeserializerTest extends AbstractDeserializerT
 
         assertEquals(1, flowAndStatisticsMapList.getInstructions().getInstruction().size());
 
-        final Instruction instruction = flowAndStatisticsMapList.getInstructions().getInstruction().get(0).getInstruction();
-        assertEquals(ApplyActionsCase.class, instruction.getImplementedInterface());
+        final Instruction instruction =
+                flowAndStatisticsMapList.getInstructions().nonnullInstruction().values().iterator().next()
+                        .getInstruction();
+        assertEquals(ApplyActionsCase.class, instruction.implementedInterface());
 
-        final ApplyActionsCase applyActions = ApplyActionsCase.class.cast(instruction);
+        final ApplyActionsCase applyActions = (ApplyActionsCase) instruction;
         assertEquals(1, applyActions.getApplyActions().getAction().size());
-        assertEquals(PopPbbActionCase.class, applyActions.getApplyActions().getAction().get(0)
-                .getAction().getImplementedInterface());
+        assertEquals(PopPbbActionCase.class, applyActions.getApplyActions().nonnullAction().values().iterator().next()
+                .getAction().implementedInterface());
     }
 }