2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.netconf.util.messages;
12 import com.google.common.base.Optional;
14 import org.junit.Before;
15 import org.junit.Test;
16 import org.mockito.internal.util.collections.Sets;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
21 public class NetconfHelloMessageTest {
26 public void setUp() throws Exception {
27 caps = Sets.newSet("cap1");
31 public void testConstructor() throws Exception {
32 NetconfHelloMessageAdditionalHeader additionalHeader = new NetconfHelloMessageAdditionalHeader("name","host","1","transp","id");
33 NetconfHelloMessage message = NetconfHelloMessage.createClientHello(caps, Optional.of(additionalHeader));
34 assertTrue(message.isHelloMessage(message));
35 assertEquals(Optional.of(additionalHeader), message.getAdditionalHeader());
37 NetconfHelloMessage serverMessage = NetconfHelloMessage.createServerHello(caps, 100L);
38 assertTrue(serverMessage.isHelloMessage(serverMessage));