summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-09-10 01:39:35 +0530
committerSandeep Jha <sandeejh@in.ibm.com>2018-09-09 20:15:08 +0000
commit872f19c71c545950efb9fb65391f2ab7ee8af1a4 (patch)
treedaa5946634f6de4d90a2e9bbac4f3da6b4905988
parentae3e71c489d17e4d7604521922926e87874e4bfd (diff)
added test case to SshJcraftWrapperTest
to increase code coverage Issue-ID: APPC-1086 Change-Id: Ic40b87f63f4b14b70870fa717bcf01f206dc982f Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/SshJcraftWrapperTest.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/SshJcraftWrapperTest.java b/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/SshJcraftWrapperTest.java
index ce2b385b2..7bf6b77d3 100644
--- a/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/SshJcraftWrapperTest.java
+++ b/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/SshJcraftWrapperTest.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2018 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
@@ -20,7 +22,7 @@
*
* ============LICENSE_END=========================================================
*/
-
+
package org.onap.appc.ccadaptor;
import static org.junit.Assert.assertEquals;
@@ -66,6 +68,7 @@ import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.appc.ccadaptor.SshJcraftWrapper.MyUserInfo;
import org.apache.commons.io.IOUtils;
@RunWith(MockitoJUnitRunner.class)
@@ -137,4 +140,22 @@ public class SshJcraftWrapperTest {
SshJcraftWrapper wrapper = new SshJcraftWrapper();
wrapper.checkIfReceivedStringMatchesDelimeter(3, "test");
}
+
+ @Test(expected=IOException.class)
+ public void testConnect() throws IOException{
+ SshJcraftWrapper wrapper = new SshJcraftWrapper();
+ wrapper.connect("testHost", "testUser", "testPswd", "3000", 1000);
+ }
+
+ @Test
+ public void testMyUserInfoGetPassword() {
+ MyUserInfo myUserInfo=new MyUserInfo();
+ assertNull(myUserInfo.getPassword());
+ }
+
+ @Test
+ public void testMyUserInfoPromptYesNo() {
+ MyUserInfo myUserInfo=new MyUserInfo();
+ assertFalse(myUserInfo.promptYesNo(""));
+ }
}