aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhekeguang <hekeguang@chinamobile.com>2020-09-07 16:27:21 +0800
committerxu ran <xuranyjy@chinamobile.com>2020-09-07 08:37:21 +0000
commit6835146775eaf70d860f1b076863ad23b35c9554 (patch)
treec653efa5c00a918c5e00594d5b9e269b2a85d2ff
parent9aa9f7fe73be81e67e582ccc36ab59c537f4bc9c (diff)
Add code related to Slicing kpi.
Issue-ID: USECASEUI-444 Change-Id: Iaf9356b6b33462f2400c7133e733f05830cf304f Signed-off-by: hekeguang <hekeguang@chinamobile.com>
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvertTest.java17
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalBandwidthTest.java15
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalTrafficTest.java17
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiUserNumberTest.java15
4 files changed, 42 insertions, 22 deletions
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvertTest.java b/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvertTest.java
index bf92878f..ab8eb990 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvertTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvertTest.java
@@ -24,12 +24,14 @@ import org.junit.Test;
import org.onap.usecaseui.server.bean.nsmf.monitor.ServiceInfo;
import org.onap.usecaseui.server.bean.nsmf.monitor.ServiceOnlineUserInfo;
import org.onap.usecaseui.server.bean.nsmf.monitor.ServiceTotalBandwidthInfo;
+import org.onap.usecaseui.server.bean.nsmf.monitor.TrafficReqInfo;
import org.onap.usecaseui.server.bean.nsmf.monitor.UsageTrafficInfo;
import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth.TotalBandwidth;
import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalTraffic;
import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber.UserNumbers;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.TotalBandwidth;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.TotalTraffic;
+import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.UserNumbers;
public class ResourceMonitorServiceConvertTest {
@@ -55,7 +57,12 @@ public class ResourceMonitorServiceConvertTest {
usageTrafficInfo.setTrafficData("600");
KpiTotalTraffic kpiTotalTraffic = new KpiTotalTraffic();
- kpiTotalTraffic.setId("1234-5678-rt45-3456");
+ List<TotalTraffic> totalTrafficList = new ArrayList<>();
+ kpiTotalTraffic.setResult(totalTrafficList);
+
+ TrafficReqInfo trafficReqInfo = new TrafficReqInfo();
+ trafficReqInfo.setId("1234-5678-rt45-3456");
+ kpiTotalTraffic.setRequest(trafficReqInfo);
resourceMonitorServiceConvert.convertUsageTrafficInfo(usageTrafficInfo, kpiTotalTraffic);
}
@@ -78,7 +85,7 @@ public class ResourceMonitorServiceConvertTest {
userNumbers.setUserNumber(1);
userNumbers.setTimeStamp("2019-12-23 11:31:19");
userNumbersList.add(userNumbers);
- kpiUserNumber.setUserNumbers(userNumbersList);
+ kpiUserNumber.setResult(userNumbersList);
try {
resourceMonitorServiceConvert.convertServiceOnlineUserInfo(serviceOnlineUserInfo, kpiUserNumber);
@@ -101,7 +108,7 @@ public class ResourceMonitorServiceConvertTest {
totalBandwidth.setBandwidth(100);
totalBandwidth.setTimeStamp("2019-12-23 11:31:19");
totalBandwidthList.add(totalBandwidth);
- kpiTotalBandwidth.setTotalBandwidth(totalBandwidthList);
+ kpiTotalBandwidth.setResult(totalBandwidthList);
try {
resourceMonitorServiceConvert
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalBandwidthTest.java b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalBandwidthTest.java
index 7733f687..daf3bc6f 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalBandwidthTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalBandwidthTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth.TotalBandwidth;
+import org.onap.usecaseui.server.bean.nsmf.monitor.SlicingKpiReqInfo;
public class KpiTotalBandwidthTest {
@@ -43,11 +43,14 @@ public class KpiTotalBandwidthTest {
totalBandwidth.getTimeStamp();
totalBandwidth.getBandwidth();
totalBandwidthList.add(totalBandwidth);
- kpiTotalBandwidth.setTotalBandwidth(totalBandwidthList);
- kpiTotalBandwidth.setId("id001");
-
- kpiTotalBandwidth.getTotalBandwidth();
- kpiTotalBandwidth.getId();
+ kpiTotalBandwidth.setResult(totalBandwidthList);
+ SlicingKpiReqInfo slicingKpiReqInfo = new SlicingKpiReqInfo();
+ kpiTotalBandwidth.setRequest(slicingKpiReqInfo);
+ kpiTotalBandwidth.setResult_count(1);
+
+ kpiTotalBandwidth.getResult();
+ kpiTotalBandwidth.getRequest();
+ kpiTotalBandwidth.getResult_count();
}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalTrafficTest.java b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalTrafficTest.java
index 5267928c..afaf5ead 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalTrafficTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiTotalTrafficTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth.TotalBandwidth;
+import org.onap.usecaseui.server.bean.nsmf.monitor.TrafficReqInfo;
public class KpiTotalTrafficTest {
@@ -35,11 +35,18 @@ public class KpiTotalTrafficTest {
@Test
public void testSetAndGetKpiTotalTraffic() throws Exception {
KpiTotalTraffic kpiTotalTraffic = new KpiTotalTraffic();
- kpiTotalTraffic.setId("id001");
- kpiTotalTraffic.setTotalTraffic(1024);
- kpiTotalTraffic.getId();
- kpiTotalTraffic.getTotalTraffic();
+ List<TotalTraffic> totalTrafficList = new ArrayList<>();
+ kpiTotalTraffic.setResult(totalTrafficList);
+
+ TrafficReqInfo trafficReqInfo = new TrafficReqInfo();
+ kpiTotalTraffic.setRequest(trafficReqInfo);
+
+ kpiTotalTraffic.setResult_count(3);
+
+ kpiTotalTraffic.getRequest();
+ kpiTotalTraffic.getResult();
+ kpiTotalTraffic.getResult_count();
}
}
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiUserNumberTest.java b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiUserNumberTest.java
index 95548b0c..036c96c6 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiUserNumberTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiUserNumberTest.java
@@ -20,8 +20,7 @@ import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiTotalBandwidth.TotalBandwidth;
-import org.onap.usecaseui.server.service.slicingdomain.kpi.bean.KpiUserNumber.UserNumbers;
+import org.onap.usecaseui.server.bean.nsmf.monitor.SlicingKpiReqInfo;
public class KpiUserNumberTest {
@@ -37,11 +36,15 @@ public class KpiUserNumberTest {
public void testSetAndGetKpiUserNumber() throws Exception {
KpiUserNumber kpiUserNumber = new KpiUserNumber();
List<UserNumbers> userNumbersList = new ArrayList<>();
- kpiUserNumber.setUserNumbers(userNumbersList);
- kpiUserNumber.setId("id001");
+ kpiUserNumber.setResult(userNumbersList);
- kpiUserNumber.getUserNumbers();
- kpiUserNumber.getId();
+ SlicingKpiReqInfo slicingKpiReqInfo = new SlicingKpiReqInfo();
+ kpiUserNumber.setRequest(slicingKpiReqInfo);
+ kpiUserNumber.setResult_count(3);
+
+ kpiUserNumber.getResult();
+ kpiUserNumber.getRequest();
+ kpiUserNumber.getResult_count();
}