From af789fd839f200a19e8610ee0376772488d4d80e Mon Sep 17 00:00:00 2001 From: sekharhuawei Date: Fri, 21 Aug 2020 15:47:00 +0530 Subject: Code coverage should be at least 55% Issue-ID: VFC-1726 Signed-off-by: sekharhuawei Change-Id: I42e6a6e5acc26c14a3c0d63ae200790c1d915f9f --- .../service/csm/api/ConnectInfoTest.java | 36 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'huawei') 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()); + } } -- cgit 1.2.3-korg