Fix most bgp-parser-impl checkstyle
[bgpcep.git] / bgp / parser-impl / src / test / java / org / opendaylight / protocol / bgp / parser / impl / IPv6NextHopTest.java
1 /*
2  * Copyright (c) 2013 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.impl;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHop;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHopBuilder;
18
19 public class IPv6NextHopTest {
20     private Ipv6NextHop nextHopA;
21     private Ipv6NextHop nextHopB;
22
23     @Before
24     public void init() {
25         this.nextHopA = new Ipv6NextHopBuilder().setGlobal(new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:7331")).build();
26         this.nextHopB = new Ipv6NextHopBuilder().setGlobal(new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:7331"))
27                 .setLinkLocal(new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:0000")).build();
28     }
29
30     @Test
31     public void testGetGlobal() {
32         final Ipv6Address globalTestAddress = new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:7331");
33
34         assertEquals(this.nextHopA.getGlobal(), globalTestAddress);
35         assertEquals(this.nextHopB.getGlobal(), globalTestAddress);
36     }
37
38     @Test
39     public void testGetLinkLocal() {
40         final Ipv6Address localTestAddress = new Ipv6Address("2001:db8:85a3:0:0:8a2e:370:0000");
41
42         assertNull(this.nextHopA.getLinkLocal());
43         assertEquals(this.nextHopB.getLinkLocal(), localTestAddress);
44     }
45 }