summaryrefslogtreecommitdiffstats
path: root/adaptors/ssh-adaptor/ssh-adaptor-bundle/src
diff options
context:
space:
mode:
authorGanesh <ganesh.c@samsung.com>2022-04-07 13:02:06 +0530
committerGanesh <ganesh.c@samsung.com>2022-04-08 19:44:21 +0530
commitff6b20220ab657ef20ec40d84ee36c4be04e1f94 (patch)
tree3013b27138789372d32ac10a54279708e3f5db9a /adaptors/ssh-adaptor/ssh-adaptor-bundle/src
parentf02d627cf47612465886e67cd9b6b27b04a3c56f (diff)
Merged CCSDKadaptor unit test cases
Signed-off-by: Ganesh <ganesh.c@samsung.com> Change-Id: If4b4969c30219c55b6455323348b222d2f6df69f Issue-ID: CCSDK-3476
Diffstat (limited to 'adaptors/ssh-adaptor/ssh-adaptor-bundle/src')
-rw-r--r--adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/TestSshAdaptorMock.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/TestSshAdaptorMock.java b/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/TestSshAdaptorMock.java
index 53048986a..dda620eab 100644
--- a/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/TestSshAdaptorMock.java
+++ b/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/TestSshAdaptorMock.java
@@ -73,5 +73,24 @@ public class TestSshAdaptorMock {
sshAdaptorMock.getConnection("localhost", 8080, "keyFile");
assertFalse(sshAdaptorMock.getConnectionMocks().isEmpty());
}
+ @Test
+ public void testGetConnectionFailureCaseBasicAuth() {
+ sshAdaptorMock.setReturnStatus(400);
+ sshAdaptorMock.setReturnStdout("Bad Request");
+ sshAdaptorMock.setReturnStderr("error");
+ sshAdaptorMock.getConnection("localhost", 8080, "myUser", "myPassword");
+ assertFalse(sshAdaptorMock.getConnectionMocks().isEmpty());
+ assertNotNull(sshAdaptorMock.getConnectionMocks());
+ }
+
+ @Test
+ public void testGetConnectionFailureCaseKey() {
+ SshAdaptorMock sshAdaptorMock = new SshAdaptorMock();
+ sshAdaptorMock.setReturnStatus(400);
+ sshAdaptorMock.setReturnStdout("Bad Request");
+ sshAdaptorMock.setReturnStderr("error");
+ sshAdaptorMock.getConnection("localhost", 8080, "keyFile");
+ assertFalse(sshAdaptorMock.getConnectionMocks().isEmpty());
+ }
}