2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
 
   7  * ================================================================================
 
   8  * Licensed under the Apache License, Version 2.0 (the "License");
 
   9  * you may not use this file except in compliance with the License.
 
  10  * You may obtain a copy of the License at
 
  12  *      http://www.apache.org/licenses/LICENSE-2.0
 
  14  * Unless required by applicable law or agreed to in writing, software
 
  15  * distributed under the License is distributed on an "AS IS" BASIS,
 
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  17  * See the License for the specific language governing permissions and
 
  18  * limitations under the License.
 
  19  * ============LICENSE_END=========================================================
 
  22 package org.openecomp.appc.dg.netconf.impl;
 
  24 import org.openecomp.appc.adapter.netconf.NetconfClient;
 
  25 import org.openecomp.appc.adapter.netconf.NetconfConnectionDetails;
 
  26 import org.openecomp.appc.exceptions.APPCException;
 
  29 public class NetconfClientJschMock implements NetconfClient {
 
  31     private boolean connection;
 
  32     private String lastMessage;
 
  33     private String answer = "answer";
 
  34     private String configuration;
 
  35     private NetconfConnectionDetails lastConnectionDetails;
 
  37     public boolean isConnection() {
 
  41     public String getLastMessage() {
 
  45     public String getAnswer() {
 
  49     public String getConf() {
 
  53     public void setConf(String configuration) {
 
  54         this.configuration = configuration;
 
  57     public void setAnswer(String answer) {
 
  61     public NetconfConnectionDetails getLastConnectionDetails() {
 
  62         return lastConnectionDetails;
 
  66     public void connect(NetconfConnectionDetails connectionDetails) throws APPCException {
 
  67         this.connection = true;
 
  68         this.lastConnectionDetails = connectionDetails;
 
  73     public String exchangeMessage(String message) throws APPCException {
 
  75             this.lastMessage = message;
 
  81     public void configure(String configuration) throws APPCException {
 
  83             this.configuration = configuration;
 
  89     public String getConfiguration() throws APPCException {
 
  96     public void disconnect() throws APPCException {
 
  97         this.connection = false;