Fix findbugs violations in netconf
[netconf.git] / netconf / netconf-netty-util / src / test / java / org / opendaylight / netconf / nettyutil / handler / EOMFramingMechanismEncoderTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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.netconf.nettyutil.handler;
10
11 import static org.junit.Assert.assertEquals;
12
13 import io.netty.buffer.ByteBuf;
14 import io.netty.buffer.Unpooled;
15 import org.junit.Test;
16
17 public class EOMFramingMechanismEncoderTest {
18
19     @Test
20     public void testEncode() throws Exception {
21         final byte[] content = new byte[50];
22         final ByteBuf source = Unpooled.wrappedBuffer(content);
23         final ByteBuf destination = Unpooled.buffer();
24         new EOMFramingMechanismEncoder().encode(null, source, destination);
25
26         assertEquals(Unpooled.wrappedBuffer(source.array(), MessageParts.END_OF_MESSAGE), destination);
27     }
28 }