2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Samsung
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.appc.adapter.netconf.jsch;
24 import org.junit.Assert;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.onap.appc.adapter.netconf.NetconfConnectionDetails;
28 import org.onap.appc.adapter.netconf.internal.NetconfAdapter;
29 import org.onap.appc.exceptions.APPCException;
31 import java.io.IOException;
33 public class TestNetconfClientJsch {
35 NetconfClientJsch netconfClientJsch;
39 netconfClientJsch = new NetconfClientJsch();
42 @Test (expected = APPCException.class)
43 public void testConnect() throws APPCException, IOException {
44 NetconfConnectionDetails connectionDetails = new NetconfConnectionDetails();
45 connectionDetails.setHost("test");
46 connectionDetails.setPort(8080);
47 connectionDetails.setUsername("test");
48 connectionDetails.setPassword("test");
50 netconfClientJsch.connect(connectionDetails);
53 @Test (expected = NullPointerException.class)
54 public void testExchangeMessage() throws APPCException, IOException {
55 String message = "test";
57 netconfClientJsch.exchangeMessage(message);
60 @Test (expected = NullPointerException.class)
61 public void testConfigure() throws APPCException, IOException {
62 String message = "test";
64 netconfClientJsch.configure(message);
67 @Test (expected = NullPointerException.class)
68 public void testConfigureOk() throws APPCException, IOException {
69 String message = "<ok/>";
71 netconfClientJsch.configure(message);
74 @Test (expected = NullPointerException.class)
75 public void testConfigureNull() throws APPCException, IOException {
76 String message = null;
78 netconfClientJsch.configure(message);