2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 
   6  * ================================================================================
 
   7  * Copyright (C) 2017 Amdocs
 
   8  * =============================================================================
 
   9  * Licensed under the Apache License, Version 2.0 (the "License");
 
  10  * you may not use this file except in compliance with the License.
 
  11  * You may obtain a copy of the License at
 
  13  *      http://www.apache.org/licenses/LICENSE-2.0
 
  15  * Unless required by applicable law or agreed to in writing, software
 
  16  * distributed under the License is distributed on an "AS IS" BASIS,
 
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  18  * See the License for the specific language governing permissions and
 
  19  * limitations under the License.
 
  21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
 
  22  * ============LICENSE_END=========================================================
 
  25 package org.openecomp.appc.dg.netconf.impl;
 
  27 import org.openecomp.appc.adapter.netconf.NetconfClient;
 
  28 import org.openecomp.appc.adapter.netconf.NetconfConnectionDetails;
 
  29 import org.openecomp.appc.exceptions.APPCException;
 
  32 public class NetconfClientJschMock implements NetconfClient {
 
  34     private boolean connection;
 
  35     private String lastMessage;
 
  36     private String answer = "answer";
 
  37     private String configuration;
 
  38     private NetconfConnectionDetails lastConnectionDetails;
 
  40     public boolean isConnection() {
 
  44     public String getLastMessage() {
 
  48     public String getAnswer() {
 
  52     public String getConf() {
 
  56     public void setConf(String configuration) {
 
  57         this.configuration = configuration;
 
  60     public void setAnswer(String answer) {
 
  64     public NetconfConnectionDetails getLastConnectionDetails() {
 
  65         return lastConnectionDetails;
 
  69     public void connect(NetconfConnectionDetails connectionDetails) throws APPCException {
 
  70         this.connection = true;
 
  71         this.lastConnectionDetails = connectionDetails;
 
  76     public String exchangeMessage(String message) throws APPCException {
 
  78             this.lastMessage = message;
 
  84     public void configure(String configuration) throws APPCException {
 
  86             this.configuration = configuration;
 
  92     public String getConfiguration() throws APPCException {
 
  99     public void disconnect() throws APPCException {
 
 100         this.connection = false;