Added test case for TestSshAdapterMock.java 40/78540/3
authorSudarshan Kumar <sudars19@in.ibm.com>
Fri, 15 Feb 2019 08:16:22 +0000 (13:46 +0530)
committerTakamune Cho <takamune.cho@att.com>
Tue, 19 Feb 2019 19:39:39 +0000 (19:39 +0000)
Added additional test case for TestSshAdapterMock.java

Issue-ID: APPC-1372
Change-Id: Ib2b6051cb8a47cc133b378d4fed6de326d37c4e5
Signed-off-by: Sudarshan Kumar <sudars19@in.ibm.com>
appc-adapters/appc-ssh-adapter/appc-ssh-adapter-tests/src/test/java/org/onap/appc/adapter/ssh/TestSshAdapterMock.java

index f3badd7..4cea70b 100644 (file)
@@ -3,7 +3,9 @@
 * ONAP : APPC
 * ================================================================================
 * Copyright 2018 TechMahindra
-*=================================================================================
+* ================================================================================
+* Modifications Copyright (c) 2019 IBM
+* ================================================================================
 * 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
@@ -62,4 +64,14 @@ public class TestSshAdapterMock {
         assertEquals(false, sshAdapterMock.getConnectionMocks().isEmpty());
         assertNotNull(sshAdapterMock.getConnectionMocks());
     }
+    
+    @Test
+    public void testGetConnection() {
+        SshAdapterMock sshAdapterMock = new SshAdapterMock();
+        sshAdapterMock.setReturnStatus(200);
+        sshAdapterMock.setReturnStdout("success");
+        sshAdapterMock.setReturnStderr("error");
+        sshAdapterMock.getConnection("localhost", 8080, "keyFile");
+        assertEquals(false, sshAdapterMock.getConnectionMocks().isEmpty());
+    }
 }