Bump mdsal to 5.0.2
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / util / ListSerializerTest.java
1 /*
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.util;
10
11 import io.netty.buffer.ByteBuf;
12 import io.netty.buffer.PooledByteBufAllocator;
13 import java.util.List;
14 import org.junit.Assert;
15 import org.junit.Test;
16 import org.junit.runner.RunWith;
17 import org.mockito.Mock;
18 import org.mockito.runners.MockitoJUnitRunner;
19 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
21
22 /**
23  * Unit tests for ListSerializer.
24  *
25  * @author michal.polkorab
26  */
27 @RunWith(MockitoJUnitRunner.class)
28 public class ListSerializerTest {
29
30     @Mock TypeKeyMaker<Action> keyMaker;
31     @Mock SerializerRegistry registry;
32
33     /**
34      * Tests {@link ListSerializer#serializeHeaderList(List, TypeKeyMaker, SerializerRegistry, ByteBuf)}
35      * with null List.
36      */
37     @Test
38     public void test() {
39         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
40         ListSerializer.serializeHeaderList(null, keyMaker, registry, buffer);
41
42         Assert.assertEquals("Data written to buffer", 0, buffer.readableBytes());
43     }
44 }