summaryrefslogtreecommitdiffstats
path: root/adaptors/ssh-adaptor
diff options
context:
space:
mode:
Diffstat (limited to 'adaptors/ssh-adaptor')
-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());
+ }
}