Update MRI projects for Aluminium
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / messages / GroupMessageDeserializerTest.java
index fe15c4638c81ff0d1bd25c60c1f9a73f13f77496..81f52b80ede7fd0594fe69f1b7a986d0be5094a9 100644 (file)
@@ -5,11 +5,12 @@
  * 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.protocol.deserialization.messages;
 
 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.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
@@ -20,9 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupModCommand;
 
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.UnpooledByteBufAllocator;
-
 public class GroupMessageDeserializerTest extends AbstractDeserializerTest {
 
     private static final byte PADDING = 1;
@@ -45,7 +43,7 @@ public class GroupMessageDeserializerTest extends AbstractDeserializerTest {
     }
 
     @Test
-    public void deserialize() throws Exception {
+    public void deserialize() {
         // Group header
         buffer.writeByte(TYPE);
         buffer.writeShort(EncodeConstants.EMPTY_LENGTH);
@@ -80,12 +78,13 @@ public class GroupMessageDeserializerTest extends AbstractDeserializerTest {
         assertEquals(GROUP_TYPE.getIntValue(), message.getGroupType().getIntValue());
         assertEquals(1, message.getBuckets().getBucket().size());
 
-        final Bucket bucket = message.getBuckets().getBucket().get(0);
+        final Bucket bucket = message.getBuckets().nonnullBucket().values().iterator().next();
         assertEquals(WEIGHT, bucket.getWeight().shortValue());
         assertEquals(WATCH_PORT, bucket.getWatchPort().intValue());
         assertEquals(WATCH_GROUP, bucket.getWatchGroup().intValue());
         assertEquals(1, bucket.getAction().size());
-        assertEquals(PopPbbActionCase.class, bucket.getAction().get(0).getAction().getImplementedInterface());
+        assertEquals(PopPbbActionCase.class,
+            bucket.nonnullAction().values().iterator().next().getAction().implementedInterface());
     }
 
 }