summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeitao Gao <victor.gao@huawei.com>2020-08-24 13:08:36 +0000
committerGerrit Code Review <gerrit@onap.org>2020-08-24 13:08:36 +0000
commit05b1538617014590fb90488da6278129a78a3fc0 (patch)
treee36bc9f18aa08605e11af9432c9c51a110750e7c
parenta3398645b7032c25d46ea0d156293a72caa47d18 (diff)
parentaf789fd839f200a19e8610ee0376772488d4d80e (diff)
Merge "Code coverage should be at least 55% Issue-ID: VFC-1726"
-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());
+ }
}