Update MRI upstreams for Phosphorus
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / protocol / serialization / multipart / MultipartRequestPortDescSerializerTest.java
1 /*
2  * Copyright (c) 2017 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 package org.opendaylight.openflowplugin.impl.protocol.serialization.multipart;
9
10 import static org.junit.Assert.assertEquals;
11
12 import io.netty.buffer.ByteBuf;
13 import io.netty.buffer.UnpooledByteBufAllocator;
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
16 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
17 import org.opendaylight.openflowplugin.impl.protocol.serialization.AbstractSerializerTest;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDesc;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.multipart.request.multipart.request.body.MultipartRequestPortDescBuilder;
20
21 public class MultipartRequestPortDescSerializerTest extends AbstractSerializerTest {
22     private static final MultipartRequestPortDesc BODY = new MultipartRequestPortDescBuilder()
23             .build();
24
25     private MultipartRequestPortDescSerializer serializer;
26
27     @Override
28     protected void init() {
29         serializer = getRegistry().getSerializer(new MessageTypeKey<>(EncodeConstants.OF_VERSION_1_3,
30                 MultipartRequestPortDesc.class));
31     }
32
33     @Test
34     public void testSerialize() {
35         final ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
36         serializer.serialize(BODY, out);
37         assertEquals(out.readableBytes(), 0);
38     }
39 }