Fix most bgp-parser-spi checkstyle violations
[bgpcep.git] / bgp / parser-spi / src / test / java / org / opendaylight / protocol / bgp / parser / spi / extended / community / AbstractIpv4ExtendedCommunityTest.java
1 /*
2  * Copyright (c) 2015 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 package org.opendaylight.protocol.bgp.parser.spi.extended.community;
9
10 import io.netty.buffer.ByteBuf;
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
14
15 public class AbstractIpv4ExtendedCommunityTest {
16
17     @Test
18     public void testGetType() {
19         final AbstractIpv4ExtendedCommunity abstractIpv4ExtendedCommunity = new AbstractIpv4ExtendedCommunity() {
20             @Override
21             public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity,
22                     final ByteBuf byteAggregator) {
23             }
24
25             @Override
26             public int getSubType() {
27                 return 0;
28             }
29
30             @Override
31             public ExtendedCommunity parseExtendedCommunity(final ByteBuf buffer) {
32                 return null;
33             }
34         };
35         Assert.assertEquals(1, abstractIpv4ExtendedCommunity.getType(true));
36         Assert.assertEquals(65, abstractIpv4ExtendedCommunity.getType(false));
37     }
38 }