summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsekharhuawei <reddi.shekhar@huawei.com>2020-08-21 15:47:00 +0530
committersekharhuawei <reddi.shekhar@huawei.com>2020-08-21 15:47:00 +0530
commitaf789fd839f200a19e8610ee0376772488d4d80e (patch)
tree3e45d1b857176ee1ab9bbd89a4aabe9fcad69de9
parent81529f59455b00b2aa0e7b36f8dee872567143a3 (diff)
Code coverage should be at least 55%
Issue-ID: VFC-1726 Signed-off-by: sekharhuawei <reddi.shekhar@huawei.com> Change-Id: I42e6a6e5acc26c14a3c0d63ae200790c1d915f9f
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/service/src/test/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/api/ConnectInfoTest.java36
1 files changed, 32 insertions, 4 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/test/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/api/ConnectInfoTest.java b/huawei/vnfmadapter/VnfmadapterService/service/src/test/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/api/ConnectInfoTest.java
index 93e9e39f..85fd92c5 100644
--- a/huawei/vnfmadapter/VnfmadapterService/service/src/test/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/api/ConnectInfoTest.java
+++ b/huawei/vnfmadapter/VnfmadapterService/service/src/test/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/csm/api/ConnectInfoTest.java
@@ -16,10 +16,10 @@
package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.csm.api;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.csm.api.ConnectInfo;
+import junit.framework.Assert;
public class ConnectInfoTest {
@@ -85,6 +85,34 @@ public class ConnectInfoTest {
ConnectInfo info2 = new ConnectInfo("localhost","user","password","auth");
assertTrue(!info1.equals(info2));
}
-
-
+ @Test
+ public void setUrlTest() throws NoSuchFieldException, IllegalAccessException {
+ ConnectInfo connectInfo = new ConnectInfo("localhost");
+ connectInfo.setUrl("localhost");
+ assertTrue(connectInfo.getUrl().equals("localhost"));
+ }
+ @Test
+ public void setUserNameTest() throws NoSuchFieldException, IllegalAccessException {
+ ConnectInfo connectInfo = new ConnectInfo("localhost");
+ connectInfo.setUserName("user");
+ assertTrue(connectInfo.getUserName().equals("user"));
+ }
+ @Test
+ public void setUserPwdTest() throws NoSuchFieldException, IllegalAccessException {
+ ConnectInfo connectInfo = new ConnectInfo("localhost");
+ connectInfo.setUserPwd("password");
+ assertTrue(connectInfo.getUserPwd().equals("password"));
+ }
+ @Test
+ public void setAuthenticateModeTest() throws NoSuchFieldException, IllegalAccessException {
+ ConnectInfo connectInfo = new ConnectInfo("localhost");
+ connectInfo.setAuthenticateMode("auth");
+ assertTrue(connectInfo.getAuthenticateMode().equals("auth"));
+ }
+ @Test
+ public void testToString() {
+ ConnectInfo connectInfo = new ConnectInfo("localhost","user","password","auth");
+ String expected = connectInfo.toString();
+ Assert.assertEquals(expected, connectInfo.toString());
+ }
}