Mass replace CRLF->LF
[openflowjava.git] / 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
14 import java.util.List;
15
16 import org.junit.Assert;
17 import org.junit.Test;
18 import org.junit.runner.RunWith;
19 import org.mockito.Mock;
20 import org.mockito.runners.MockitoJUnitRunner;
21 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.grouping.Action;
23
24 /**
25  * @author michal.polkorab
26  *
27  */
28 @RunWith(MockitoJUnitRunner.class)
29 public class ListSerializerTest {
30
31     @Mock TypeKeyMaker<Action> keyMaker;
32     @Mock SerializerRegistry registry;
33
34     /**
35      * Tests {@link ListSerializer#serializeHeaderList(List, TypeKeyMaker, SerializerRegistry, ByteBuf)}
36      * with null List
37      */
38     @Test
39     public void test() {
40         ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer();
41         ListSerializer.serializeHeaderList(null, keyMaker, registry, buffer);
42
43         Assert.assertEquals("Data written to buffer", 0, buffer.readableBytes());
44     }
45 }