diff --git a/appc-dg/appc-dg-shared/appc-dg-license-manager/pom.xml b/appc-dg/appc-dg-shared/appc-dg-license-manager/pom.xml
index e1b8f74..8047bd2 100644
--- a/appc-dg/appc-dg-shared/appc-dg-license-manager/pom.xml
+++ b/appc-dg/appc-dg-shared/appc-dg-license-manager/pom.xml
@@ -55,6 +55,11 @@
 			<artifactId>sli-provider</artifactId>
 			<scope>compile</scope>
 		</dependency>
+		<dependency>
+			<groupId>org.mockito</groupId>
+			<artifactId>mockito-core</artifactId>
+			<scope>test</scope>
+		</dependency>
 	</dependencies>
 
 	<build>
diff --git a/appc-dg/appc-dg-shared/appc-dg-license-manager/src/main/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImpl.java b/appc-dg/appc-dg-shared/appc-dg-license-manager/src/main/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImpl.java
index 1f9cd94..281d327 100644
--- a/appc-dg/appc-dg-shared/appc-dg-license-manager/src/main/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-license-manager/src/main/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImpl.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -76,8 +78,14 @@
 
             LicenseModel licenseModel = licenseManager.retrieveLicenseModel(params.get(Constants.VNF_TYPE_FIELD_NAME), params.get(Constants.VNF_RESOURCE_VERSION_FIELD_NAME));
 
-            String modelEntitlementPoolUuid = licenseModel.getEntitlementPoolUuid(); if (null == modelEntitlementPoolUuid) modelEntitlementPoolUuid = "";
-            String aaiEntitlementPoolUuid = ctx.getAttribute(Constants.AAI_ENTITLMENT_POOL_UUID_NAME); if (null == aaiEntitlementPoolUuid) aaiEntitlementPoolUuid = "";
+            String modelEntitlementPoolUuid = licenseModel.getEntitlementPoolUuid();
+            if (null == modelEntitlementPoolUuid) {
+                modelEntitlementPoolUuid = "";
+            }
+            String aaiEntitlementPoolUuid = ctx.getAttribute(Constants.AAI_ENTITLMENT_POOL_UUID_NAME);
+            if (null == aaiEntitlementPoolUuid) {
+                aaiEntitlementPoolUuid = "";
+            }
             boolean isAcquireEntitlementRequire = !modelEntitlementPoolUuid.isEmpty() && !modelEntitlementPoolUuid.equals(aaiEntitlementPoolUuid);
             boolean isReleaseEntitlementRequire = !aaiEntitlementPoolUuid.isEmpty() && (isAcquireEntitlementRequire || modelEntitlementPoolUuid.isEmpty());
             boolean isAAIEntitlementUpdateRequire = isAcquireEntitlementRequire || isReleaseEntitlementRequire;
@@ -87,9 +95,18 @@
             ctx.setAttribute(Constants.IS_AAI_ENTITLEMENT_UPDATE_REQUIRE, Boolean.toString(isAAIEntitlementUpdateRequire));
 
 
-            String modelLicenseKeyGroupUuid = licenseModel.getLicenseKeyGroupUuid(); if (null == modelLicenseKeyGroupUuid) modelLicenseKeyGroupUuid = "";
-            String aaiLicenseKeyGroupUuid = ctx.getAttribute(Constants.AAI_LICENSE_KEY_UUID_NAME); if (null == aaiLicenseKeyGroupUuid) aaiLicenseKeyGroupUuid = "";
-            String aaiLicenseKeyValue = ctx.getAttribute(Constants.AAI_LICENSE_KEY_VALUE); if (null == aaiLicenseKeyValue) aaiLicenseKeyValue = "";
+            String modelLicenseKeyGroupUuid = licenseModel.getLicenseKeyGroupUuid();
+            if (null == modelLicenseKeyGroupUuid) {
+                modelLicenseKeyGroupUuid = "";
+            }
+            String aaiLicenseKeyGroupUuid = ctx.getAttribute(Constants.AAI_LICENSE_KEY_UUID_NAME);
+            if (null == aaiLicenseKeyGroupUuid) {
+                aaiLicenseKeyGroupUuid = "";
+            }
+            String aaiLicenseKeyValue = ctx.getAttribute(Constants.AAI_LICENSE_KEY_VALUE);
+            if (null == aaiLicenseKeyValue) {
+                aaiLicenseKeyValue = "";
+            }
             boolean isAcquireLicenseRequire = !modelLicenseKeyGroupUuid.isEmpty() && !modelLicenseKeyGroupUuid.equals(aaiLicenseKeyGroupUuid);
             boolean isReleaseLicenseRequire = !aaiLicenseKeyGroupUuid.isEmpty() && (isAcquireLicenseRequire || modelLicenseKeyGroupUuid.isEmpty());
             boolean isAAILicenseUpdateRequire = isAcquireLicenseRequire || isReleaseLicenseRequire;
diff --git a/appc-dg/appc-dg-shared/appc-dg-license-manager/src/test/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImplTest.java b/appc-dg/appc-dg-shared/appc-dg-license-manager/src/test/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImplTest.java
new file mode 100644
index 0000000..cee75ba
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-license-manager/src/test/java/org/onap/appc/dg/licmgr/impl/LicenseManagerPluginImplTest.java
@@ -0,0 +1,56 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2019 Ericsson
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.dg.licmgr.impl;
+
+import org.junit.Assert;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.appc.exceptions.APPCException;
+import org.onap.appc.licmgr.LicenseManager;
+import org.onap.appc.licmgr.objects.LicenseModel;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.mockito.Mockito;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(LicenseModel.class)
+public class LicenseManagerPluginImplTest {
+
+    private LicenseManager licenseManagerMock = Mockito.mock(LicenseManager.class);
+    private LicenseModel licenseModelMock = PowerMockito.mock(LicenseModel.class);
+
+    @Test
+    public void testRetrieveLicenseModel() throws APPCException {
+        LicenseManagerPluginImpl lmImpl = new LicenseManagerPluginImpl();
+        lmImpl.setLicenseManager(licenseManagerMock);
+        Mockito.doReturn(licenseModelMock).when(licenseManagerMock).retrieveLicenseModel(Mockito.anyString(), Mockito.anyString());
+        Map<String, String> params = new HashMap<>();
+        SvcLogicContext ctx = new SvcLogicContext();
+        lmImpl.retrieveLicenseModel(params, ctx);
+        Assert.assertEquals("", ctx.getAttribute("license-key"));
+    }
+
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-netconf/src/test/java/org/onap/appc/dg/netconf/impl/NetconfClientPluginImplTest.java b/appc-dg/appc-dg-shared/appc-dg-netconf/src/test/java/org/onap/appc/dg/netconf/impl/NetconfClientPluginImplTest.java
index b1724ac..9e2384e 100644
--- a/appc-dg/appc-dg-shared/appc-dg-netconf/src/test/java/org/onap/appc/dg/netconf/impl/NetconfClientPluginImplTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-netconf/src/test/java/org/onap/appc/dg/netconf/impl/NetconfClientPluginImplTest.java
@@ -33,9 +33,15 @@
 import org.junit.runner.RunWith;
 import org.mockito.Matchers;
 import org.mockito.Mockito;
-import org.onap.appc.adapter.netconf.*;
 import org.onap.appc.adapter.netconf.util.Constants;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.appc.adapter.netconf.ConnectionDetails;
+import org.onap.appc.adapter.netconf.NetconfClientFactory;
+import org.onap.appc.adapter.netconf.NetconfClientType;
+import org.onap.appc.adapter.netconf.NetconfConnectionDetails;
+import org.onap.appc.adapter.netconf.NetconfDataAccessService;
+import org.onap.appc.adapter.netconf.OperationalStateValidatorFactory;
+import org.onap.appc.adapter.netconf.VnfType;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
diff --git a/appc-dg/appc-dg-shared/appc-dg-ssh/src/main/java/org/onap/appc/dg/ssh/impl/SshServiceImpl.java b/appc-dg/appc-dg-shared/appc-dg-ssh/src/main/java/org/onap/appc/dg/ssh/impl/SshServiceImpl.java
index c1b9db3..e758f36 100644
--- a/appc-dg/appc-dg-shared/appc-dg-ssh/src/main/java/org/onap/appc/dg/ssh/impl/SshServiceImpl.java
+++ b/appc-dg/appc-dg-shared/appc-dg-ssh/src/main/java/org/onap/appc/dg/ssh/impl/SshServiceImpl.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,68 +43,68 @@
 
 public class SshServiceImpl implements SshService {
 
-	private static final EELFLogger logger = EELFManager.getInstance().getApplicationLogger();
-	private static final ObjectMapper mapper = new ObjectMapper();
+    private static final EELFLogger logger = EELFManager.getInstance().getApplicationLogger();
+    private static final ObjectMapper mapper = new ObjectMapper();
 
-	private SshAdapter sshAdapter;
+    private SshAdapter sshAdapter;
 
-	public void setSshAdapter(SshAdapter sshAdapter) {
-		this.sshAdapter = sshAdapter;
-	}
+    public void setSshAdapter(SshAdapter sshAdapter) {
+        this.sshAdapter = sshAdapter;
+    }
 
-	@Override
-	public void exec(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
-		SshConnectionDetails connectionDetails = resolveConnectionDetails(params.get(PARAM_IN_connection_details));
-		String command = params.get(PARAM_IN_command);
-		logger.debug("=> Connecting to SSH server...");
-		SshConnection sshConnection = sshAdapter.getConnection(connectionDetails.getHost(), connectionDetails.getPort(), connectionDetails.getUsername(), connectionDetails.getPassword());
-		sshConnection.connect();
-		try {
-			logger.debug("=> Connected to SSH server...");
-			logger.debug("=> Running SSH command...");
-			long timeout = DEF_timeout;
-			String stimeout = params.get(PARAM_IN_timeout);
-			if ((stimeout != null && !stimeout.isEmpty())) {
-				timeout = Long.parseLong(stimeout);
-			}
-			sshConnection.setExecTimeout(timeout);
-			ByteArrayOutputStream stdout = new ByteArrayOutputStream();
-			ByteArrayOutputStream stderr = new ByteArrayOutputStream();
-			int status = sshConnection.execCommand(command, stdout, stderr);
-			String stdoutRes = stdout.toString();
-			String stderrRes = stderr.toString();
-			logger.debug("=> executed SSH command");
-			ctx.setAttribute(PARAM_OUT_status, String.format("%01d", status));
-			ctx.setAttribute(PARAM_OUT_stdout, stdoutRes);
-			ctx.setAttribute(PARAM_OUT_stderr, stderrRes);
-		} finally {
-			sshConnection.disconnect();
-		}
-	}
+    @Override
+    public void exec(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        SshConnectionDetails connectionDetails = resolveConnectionDetails(params.get(PARAM_IN_connection_details));
+        String command = params.get(PARAM_IN_command);
+        logger.debug("=> Connecting to SSH server...");
+        SshConnection sshConnection = sshAdapter.getConnection(connectionDetails.getHost(), connectionDetails.getPort(), connectionDetails.getUsername(), connectionDetails.getPassword());
+        sshConnection.connect();
+        try {
+            logger.debug("=> Connected to SSH server...");
+            logger.debug("=> Running SSH command...");
+            long timeout = DEF_timeout;
+            String stimeout = params.get(PARAM_IN_timeout);
+            if ((stimeout != null && !stimeout.isEmpty())) {
+                timeout = Long.parseLong(stimeout);
+            }
+            sshConnection.setExecTimeout(timeout);
+            ByteArrayOutputStream stdout = new ByteArrayOutputStream();
+            ByteArrayOutputStream stderr = new ByteArrayOutputStream();
+            int status = sshConnection.execCommand(command, stdout, stderr);
+            String stdoutRes = stdout.toString();
+            String stderrRes = stderr.toString();
+            logger.debug("=> executed SSH command");
+            ctx.setAttribute(PARAM_OUT_status, String.format("%01d", status));
+            ctx.setAttribute(PARAM_OUT_stdout, stdoutRes);
+            ctx.setAttribute(PARAM_OUT_stderr, stderrRes);
+        } finally {
+            sshConnection.disconnect();
+        }
+    }
 
-	private SshConnectionDetails resolveConnectionDetails(String connectionDetailsStr) throws APPCException {
-		SshConnectionDetails connectionDetails = null;
-		try {
-			connectionDetails = mapper.readValue(connectionDetailsStr, SshConnectionDetails.class);
-			if (0 == connectionDetails.getPort()) connectionDetails.setPort(DEF_port);
-		} catch (IOException e) {
-			throw new APPCException(e);
-		}
-		return connectionDetails;
-	}
+    private SshConnectionDetails resolveConnectionDetails(String connectionDetailsStr) throws APPCException {
+        SshConnectionDetails connectionDetails = null;
+        try {
+            connectionDetails = mapper.readValue(connectionDetailsStr, SshConnectionDetails.class);
+            if (0 == connectionDetails.getPort()) connectionDetails.setPort(DEF_port);
+        } catch (IOException e) {
+            throw new APPCException(e);
+        }
+        return connectionDetails;
+    }
 
-	@Override
-	public void execWithStatusCheck(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
-		exec(params, ctx);
-		int status = Integer.parseInt(ctx.getAttribute(PARAM_OUT_status));
-		if(status != DEF_SUCCESS_STATUS) {
-			StringBuilder errmsg = new StringBuilder();
-			errmsg.append("SSH command returned error status [").append(status).append(']');
-			String stderr = ctx.getAttribute(PARAM_OUT_stderr);
-			if((stderr != null) && !stderr.isEmpty()) {
-				errmsg.append(". Error: [").append(stderr).append(']');
-			}
-			throw new APPCException(errmsg.toString());
-		}
-	}
+    @Override
+    public void execWithStatusCheck(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
+        exec(params, ctx);
+        int status = Integer.parseInt(ctx.getAttribute(PARAM_OUT_status));
+        if(status != DEF_SUCCESS_STATUS) {
+            StringBuilder errmsg = new StringBuilder();
+            errmsg.append("SSH command returned error status [").append(status).append(']');
+            String stderr = ctx.getAttribute(PARAM_OUT_stderr);
+            if((stderr != null) && !stderr.isEmpty()) {
+                errmsg.append(". Error: [").append(stderr).append(']');
+            }
+            throw new APPCException(errmsg.toString());
+        }
+    }
 }
diff --git a/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshDBPluginImplTest.java b/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshDBPluginImplTest.java
new file mode 100644
index 0000000..20d602c
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshDBPluginImplTest.java
@@ -0,0 +1,80 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2019 Ericsson
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.dg.ssh.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.mockito.Mockito;
+import org.onap.appc.adapter.ssh.Constants;
+import org.onap.appc.adapter.ssh.SshConnectionDetails;
+import org.onap.appc.adapter.ssh.SshDataAccessException;
+import org.onap.appc.adapter.ssh.SshDataAccessService;
+import org.onap.appc.exceptions.APPCException;
+import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+
+public class SshDBPluginImplTest {
+
+    @Rule
+    public ExpectedException expectedEx = ExpectedException.none();
+
+    @Test
+    public void testRetrieveConnectionDetails() throws APPCException {
+        SshDBPluginImpl impl = new SshDBPluginImpl();
+        SshDataAccessService dataAccessServiceMock = Mockito.mock(SshDataAccessService.class);
+        Mockito.doReturn(true).when(dataAccessServiceMock).retrieveConnectionDetails(Mockito.anyString(),
+                Mockito.any(SshConnectionDetails.class));
+        impl.setDataAccessService(dataAccessServiceMock);
+        Map<String, String> params = new HashMap<>();
+        SvcLogicContext ctx = new SvcLogicContext();
+        impl.retrieveConnectionDetails(params, ctx);
+        Assert.assertNotNull(ctx.getAttribute(Constants.CONNECTION_DETAILS_FIELD_NAME));
+    }
+
+    @Test
+    public void testRetrieveConnectionDetailsAppcException() throws APPCException {
+        SshDBPluginImpl impl = new SshDBPluginImpl();
+        SshDataAccessService dataAccessServiceMock = Mockito.mock(SshDataAccessService.class);
+        impl.setDataAccessService(dataAccessServiceMock);
+        Map<String, String> params = new HashMap<>();
+        SvcLogicContext ctx = new SvcLogicContext();
+        expectedEx.expect(APPCException.class);
+        impl.retrieveConnectionDetails(params, ctx);
+    }
+
+    @Test
+    public void testRetrieveConnectionDetailsSshDataAccessException() throws APPCException {
+        SshDBPluginImpl impl = new SshDBPluginImpl();
+        SshDataAccessService dataAccessServiceMock = Mockito.mock(SshDataAccessService.class);
+        Mockito.doThrow(new SshDataAccessException()).when(dataAccessServiceMock).retrieveConnectionDetails(Mockito.anyString(),
+                Mockito.any(SshConnectionDetails.class));
+        impl.setDataAccessService(dataAccessServiceMock);
+        Map<String, String> params = new HashMap<>();
+        SvcLogicContext ctx = new SvcLogicContext();
+        expectedEx.expect(SshDataAccessException.class);
+        impl.retrieveConnectionDetails(params, ctx);
+    }
+
+}
diff --git a/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshServiceImplTest.java b/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshServiceImplTest.java
index 1c7780c..deaf0eb 100644
--- a/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshServiceImplTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-ssh/src/test/java/org/onap/appc/dg/ssh/impl/SshServiceImplTest.java
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,128 +47,128 @@
 
 public class SshServiceImplTest {
 
-	private static final ObjectMapper mapper = new ObjectMapper();
+    private static final ObjectMapper mapper = new ObjectMapper();
 
-	@Rule
-	public ExpectedException thrown = ExpectedException.none();
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
 
-	@Test
-	public void testExec() throws APPCException, JsonProcessingException {
-		String host = "testhost";
-		String username = "testuser";
-		String password = "testpassword";
-		String command = "cat keystonerc_Test";
+    @Test
+    public void testExec() throws APPCException, JsonProcessingException {
+        String host = "testhost";
+        String username = "testuser";
+        String password = "testpassword";
+        String command = "cat keystonerc_Test";
 
-		SshServiceImpl sshService = new SshServiceImpl();
-		SshAdapterMock sshAdapterMock = new SshAdapterMock();
-		sshService.setSshAdapter(sshAdapterMock);
+        SshServiceImpl sshService = new SshServiceImpl();
+        SshAdapterMock sshAdapterMock = new SshAdapterMock();
+        sshService.setSshAdapter(sshAdapterMock);
 
-		System.out.println("=> Executing SSH command [" + command + "]...");
+        System.out.println("=> Executing SSH command [" + command + "]...");
 
-		Map<String, String> params = new HashMap<>();
-		params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
-		params.put(SshService.PARAM_IN_command, command);
-		SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
-		sshService.exec(params, svcLogicContext);
-		int status = Integer.parseInt(svcLogicContext.getAttribute(SshService.PARAM_OUT_status));
-		String stdout = svcLogicContext.getAttribute(SshService.PARAM_OUT_stdout);
-		String stderr = svcLogicContext.getAttribute(SshService.PARAM_OUT_stderr);
-		System.out.println("=> SSH command [" + command + "] status is [" + status + "]. stdout is [" + stdout + "]. stderr is [" + stderr + "]");
+        Map<String, String> params = new HashMap<>();
+        params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
+        params.put(SshService.PARAM_IN_command, command);
+        SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
+        sshService.exec(params, svcLogicContext);
+        int status = Integer.parseInt(svcLogicContext.getAttribute(SshService.PARAM_OUT_status));
+        String stdout = svcLogicContext.getAttribute(SshService.PARAM_OUT_stdout);
+        String stderr = svcLogicContext.getAttribute(SshService.PARAM_OUT_stderr);
+        System.out.println("=> SSH command [" + command + "] status is [" + status + "]. stdout is [" + stdout + "]. stderr is [" + stderr + "]");
 
-		List<SshConnectionMock> connectionMocks = sshAdapterMock.getConnectionMocks();
-		Assert.assertEquals(1, connectionMocks.size());
-		SshConnectionMock connectionMock = connectionMocks.get(0);
-		Assert.assertNotNull(connectionMock);
-		Assert.assertEquals(host, connectionMock.getHost());
-		Assert.assertEquals(SshService.DEF_port, connectionMock.getPort());
-		Assert.assertEquals(username, connectionMock.getUsername());
-		Assert.assertEquals(password, connectionMock.getPassword());
-		Assert.assertEquals(1, connectionMock.getConnectCallCount());
-		Assert.assertEquals(1, connectionMock.getDisconnectCallCount());
-		List<String> executedCommands = connectionMock.getExecutedCommands();
-		Assert.assertEquals(1, executedCommands.size());
-		String executedCommand = executedCommands.get(0);
-		Assert.assertEquals(command, executedCommand);
-	}
+        List<SshConnectionMock> connectionMocks = sshAdapterMock.getConnectionMocks();
+        Assert.assertEquals(1, connectionMocks.size());
+        SshConnectionMock connectionMock = connectionMocks.get(0);
+        Assert.assertNotNull(connectionMock);
+        Assert.assertEquals(host, connectionMock.getHost());
+        Assert.assertEquals(SshService.DEF_port, connectionMock.getPort());
+        Assert.assertEquals(username, connectionMock.getUsername());
+        Assert.assertEquals(password, connectionMock.getPassword());
+        Assert.assertEquals(1, connectionMock.getConnectCallCount());
+        Assert.assertEquals(1, connectionMock.getDisconnectCallCount());
+        List<String> executedCommands = connectionMock.getExecutedCommands();
+        Assert.assertEquals(1, executedCommands.size());
+        String executedCommand = executedCommands.get(0);
+        Assert.assertEquals(command, executedCommand);
+    }
 
-	@Test
-	public void testExecWithStatusCheck() throws APPCException, JsonProcessingException {
-		String host = "testhost";
-		String username = "testuser";
-		String password = "testpassword";
-		String command = "cat keystonerc_Test";
+    @Test
+    public void testExecWithStatusCheck() throws APPCException, JsonProcessingException {
+        String host = "testhost";
+        String username = "testuser";
+        String password = "testpassword";
+        String command = "cat keystonerc_Test";
 
-		SshServiceImpl sshService = new SshServiceImpl();
-		SshAdapterMock sshAdapterMock = new SshAdapterMock();
-		sshService.setSshAdapter(sshAdapterMock);
+        SshServiceImpl sshService = new SshServiceImpl();
+        SshAdapterMock sshAdapterMock = new SshAdapterMock();
+        sshService.setSshAdapter(sshAdapterMock);
 
-		System.out.println("=> Executing SSH command [" + command + "]...");
-		Map<String, String> params = new HashMap<>();
-		params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
-		params.put(SshService.PARAM_IN_command, command);
-		SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
-		sshService.execWithStatusCheck(params, svcLogicContext);
-		int status = Integer.parseInt(svcLogicContext.getAttribute(SshService.PARAM_OUT_status));
-		String stdout = svcLogicContext.getAttribute(SshService.PARAM_OUT_stdout);
-		String stderr = svcLogicContext.getAttribute(SshService.PARAM_OUT_stderr);
-		System.out.println("=> SSH command [" + command + "] status is [" + status + "]. stdout is [" + stdout + "]. stderr is [" + stderr + "]");
+        System.out.println("=> Executing SSH command [" + command + "]...");
+        Map<String, String> params = new HashMap<>();
+        params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
+        params.put(SshService.PARAM_IN_command, command);
+        SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
+        sshService.execWithStatusCheck(params, svcLogicContext);
+        int status = Integer.parseInt(svcLogicContext.getAttribute(SshService.PARAM_OUT_status));
+        String stdout = svcLogicContext.getAttribute(SshService.PARAM_OUT_stdout);
+        String stderr = svcLogicContext.getAttribute(SshService.PARAM_OUT_stderr);
+        System.out.println("=> SSH command [" + command + "] status is [" + status + "]. stdout is [" + stdout + "]. stderr is [" + stderr + "]");
 
-		List<SshConnectionMock> connectionMocks = sshAdapterMock.getConnectionMocks();
-		Assert.assertEquals(1, connectionMocks.size());
-		SshConnectionMock connectionMock = connectionMocks.get(0);
-		Assert.assertNotNull(connectionMock);
-		Assert.assertEquals(host, connectionMock.getHost());
-		Assert.assertEquals(SshService.DEF_port, connectionMock.getPort());
-		Assert.assertEquals(username, connectionMock.getUsername());
-		Assert.assertEquals(password, connectionMock.getPassword());
-		Assert.assertEquals(1, connectionMock.getConnectCallCount());
-		Assert.assertEquals(1, connectionMock.getDisconnectCallCount());
-		List<String> executedCommands = connectionMock.getExecutedCommands();
-		Assert.assertEquals(1, executedCommands.size());
-		String executedCommand = executedCommands.get(0);
-		Assert.assertEquals(command, executedCommand);
-	}
+        List<SshConnectionMock> connectionMocks = sshAdapterMock.getConnectionMocks();
+        Assert.assertEquals(1, connectionMocks.size());
+        SshConnectionMock connectionMock = connectionMocks.get(0);
+        Assert.assertNotNull(connectionMock);
+        Assert.assertEquals(host, connectionMock.getHost());
+        Assert.assertEquals(SshService.DEF_port, connectionMock.getPort());
+        Assert.assertEquals(username, connectionMock.getUsername());
+        Assert.assertEquals(password, connectionMock.getPassword());
+        Assert.assertEquals(1, connectionMock.getConnectCallCount());
+        Assert.assertEquals(1, connectionMock.getDisconnectCallCount());
+        List<String> executedCommands = connectionMock.getExecutedCommands();
+        Assert.assertEquals(1, executedCommands.size());
+        String executedCommand = executedCommands.get(0);
+        Assert.assertEquals(command, executedCommand);
+    }
 
-	/**
-	 * Checks that execWithStatusCheck() throws appropriate exception if execution status != 0.
-	 *
-	 * @throws APPCException
-	 * @throws JsonProcessingException
-	 */
-	@Test
-	public void testExecWithStatusCheckFail() throws APPCException, JsonProcessingException {
-		String host = "testhost";
-		String username = "testuser";
-		String password = "testpassword";
-		String command = "cat keystonerc_Test";
+    /**
+     * Checks that execWithStatusCheck() throws appropriate exception if execution status != 0.
+     *
+     * @throws APPCException
+     * @throws JsonProcessingException
+     */
+    @Test
+    public void testExecWithStatusCheckFail() throws APPCException, JsonProcessingException {
+        String host = "testhost";
+        String username = "testuser";
+        String password = "testpassword";
+        String command = "cat keystonerc_Test";
 
-		int expectedStatus = 2;
-		String expectedErr = "Test failure";
+        int expectedStatus = 2;
+        String expectedErr = "Test failure";
 
-		SshServiceImpl sshService = new SshServiceImpl();
-		SshAdapterMock sshAdapterMock = new SshAdapterMock();
-		sshAdapterMock.setReturnStatus(expectedStatus);
-		sshAdapterMock.setReturnStderr(expectedErr);
-		sshService.setSshAdapter(sshAdapterMock);
+        SshServiceImpl sshService = new SshServiceImpl();
+        SshAdapterMock sshAdapterMock = new SshAdapterMock();
+        sshAdapterMock.setReturnStatus(expectedStatus);
+        sshAdapterMock.setReturnStderr(expectedErr);
+        sshService.setSshAdapter(sshAdapterMock);
 
-		thrown.expect(APPCException.class);
-		thrown.expectMessage(CoreMatchers.containsString(expectedErr));
+        thrown.expect(APPCException.class);
+        thrown.expectMessage(CoreMatchers.containsString(expectedErr));
 
-		System.out.println("=> Executing SSH command [" + command + "]...");
-		Map<String, String> params = new HashMap<>();
-		params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
-		params.put(SshService.PARAM_IN_command, command);
-		SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
-		// should fail, no need to perform further assertions
-		sshService.execWithStatusCheck(params, svcLogicContext);
-	}
+        System.out.println("=> Executing SSH command [" + command + "]...");
+        Map<String, String> params = new HashMap<>();
+        params.put(SshService.PARAM_IN_connection_details, createConnectionDetails(host,username,password));
+        params.put(SshService.PARAM_IN_command, command);
+        SvcLogicContext svcLogicContext = new SvcLogicContext(new Properties());
+        // should fail, no need to perform further assertions
+        sshService.execWithStatusCheck(params, svcLogicContext);
+    }
 
-	private String createConnectionDetails(String host, String username, String password) throws JsonProcessingException {
-		SshConnectionDetails connDetails = new SshConnectionDetails();
-		connDetails.setHost(host);
-		connDetails.setUsername(username);
-		connDetails.setPassword(password);
-		return mapper.writeValueAsString(connDetails);
-	}
+    private String createConnectionDetails(String host, String username, String password) throws JsonProcessingException {
+        SshConnectionDetails connDetails = new SshConnectionDetails();
+        connDetails.setHost(host);
+        connDetails.setUsername(username);
+        connDetails.setPassword(password);
+        return mapper.writeValueAsString(connDetails);
+    }
 
 }
