Clean up netconf-api tests
[netconf.git] / netconf / netconf-api / src / test / java / org / opendaylight / netconf / api / messages / NetconfHelloMessageAdditionalHeaderTest.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 package org.opendaylight.netconf.api.messages;
9
10 import static org.junit.Assert.assertEquals;
11
12 import org.junit.Test;
13
14 public class NetconfHelloMessageAdditionalHeaderTest {
15     private final NetconfHelloMessageAdditionalHeader header =
16         new NetconfHelloMessageAdditionalHeader("user", "1.1.1.1", "40", "tcp", "client");
17
18     @Test
19     public void testGetters() {
20         assertEquals(header.getAddress(), "1.1.1.1");
21         assertEquals(header.getUserName(), "user");
22         assertEquals(header.getPort(), "40");
23         assertEquals(header.getTransport(), "tcp");
24         assertEquals(header.getSessionIdentifier(), "client");
25     }
26
27     @Test
28     public void testStaticConstructor() {
29         final var hdr = NetconfHelloMessageAdditionalHeader.fromString("[user;1.1.1.1:40;tcp;client;]");
30         assertEquals(hdr.toString(), header.toString());
31         assertEquals(hdr.toFormattedString(), header.toFormattedString());
32     }
33 }