Move NetconfDeviceTopologyAdapter
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / NetconfDeviceSalProviderTest.java
1 /*
2  * Copyright (c) 2016 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.sal.connect.netconf.sal;
9
10 import java.net.InetSocketAddress;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.junit.runner.RunWith;
14 import org.mockito.Mock;
15 import org.mockito.junit.MockitoJUnitRunner;
16 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
17 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
18
19 @RunWith(MockitoJUnitRunner.StrictStubs.class)
20 public class NetconfDeviceSalProviderTest {
21     @Mock
22     private DOMMountPointService mountPointService;
23
24     private NetconfDeviceSalProvider provider;
25
26     @Before
27     public void setUp() {
28         provider = new NetconfDeviceSalProvider(new RemoteDeviceId("device1",
29                 InetSocketAddress.createUnresolved("localhost", 17830)), mountPointService);
30     }
31
32     @Test
33     public void close() {
34         provider.close();
35     }
36
37     @Test
38     public void closeWithoutNPE()  {
39         close();
40
41         // No further interations
42         provider.close();
43     }
44 }