From: deepikasatheesh Date: Fri, 28 Oct 2022 16:28:02 +0000 (+0000) Subject: Fixed bugs found in KPI Monitoring for new KPI X-Git-Tag: 5.2.1~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=36edc4f7b2af711bc3799a7f27d9172dad37c199;p=usecase-ui%2Fserver.git Fixed bugs found in KPI Monitoring for new KPI Issue-ID: USECASEUI-748 Signed-off-by: deepikasatheesh Change-Id: Ie545852cc39d11fbfc4a950a1576188aabbf5dc0 Signed-off-by: deepikasatheesh --- diff --git a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvert.java b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvert.java index 227ce2f7..274db67d 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvert.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/nsmf/impl/ResourceMonitorServiceConvert.java @@ -126,9 +126,11 @@ public class ResourceMonitorServiceConvert { servicePDUSessionEstSRInfo.setId(kpiPDUSessionEstSR.getRequest().getId().substring(kpiPDUSessionEstSR.getRequest().getId().lastIndexOf(".") + 1)); if (kpiPDUSessionEstSR.getResult() != null) { for (PDUSessionEstSR pDUSessionEstSR : kpiPDUSessionEstSR.getResult()) { + String newTimeStamp = NsmfCommonUtil + .timestamp2Time(pDUSessionEstSR.getTimeStamp().replace("T", NsmfParamConstant.SPACE)); PDUSessionEstSRInfo kpiPDUSessionEstSRInfo = new PDUSessionEstSRInfo(); - kpiPDUSessionEstSRInfo.setTimestamp(pDUSessionEstSR.getTimeStamp()); - kpiPDUSessionEstSRInfo.setPduSessionEstSR(String.valueOf(pDUSessionEstSR.getPDUSessionEstSR())); + kpiPDUSessionEstSRInfo.setTimestamp(newTimeStamp); + kpiPDUSessionEstSRInfo.setPduSessionEstSR(pDUSessionEstSR.getPDUSessionEstSR()); kpiPDUSessionEstSRInfoList.add(kpiPDUSessionEstSRInfo); } } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSR.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSR.java index 1a41f262..2f3c3f49 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSR.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSR.java @@ -1,35 +1,33 @@ -/** - * Copyright (C) 2022 Wipro Limited. All rights reserved. - * - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onap.usecaseui.server.service.slicingdomain.kpi.bean; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import java.util.List; -import lombok.Getter; -import lombok.Setter; -import org.onap.usecaseui.server.bean.nsmf.monitor.SlicingKpiReqInfo; - -@Getter -@Setter -@JsonIgnoreProperties(ignoreUnknown=true) -public class KpiPDUSessionEstSR { - - private List result; - - private SlicingKpiReqInfo request; - - private int result_count; - -} +/** + * Copyright (C) 2022 Wipro Limited. All rights reserved. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.slicingdomain.kpi.bean; + +import java.util.List; +import lombok.Getter; +import lombok.Setter; +import org.onap.usecaseui.server.bean.nsmf.monitor.SlicingKpiReqInfo; + +@Getter +@Setter +public class KpiPDUSessionEstSR { + + private List result; + + private SlicingKpiReqInfo request; + + private int result_count; + +} diff --git a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSR.java b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSR.java index 73da0f46..f43bebb5 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSR.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSR.java @@ -1,38 +1,31 @@ -/* - * Copyright (C) 2022 Wipro Limited. All rights reserved. - * - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onap.usecaseui.server.service.slicingdomain.kpi.bean; - -public class PDUSessionEstSR { - private String timeStamp; - - private int pDUSessionEstSR; - - public String getTimeStamp() { - return timeStamp; - } - - public void setTimeStamp(String timeStamp) { - this.timeStamp = timeStamp; - } - - public int getPDUSessionEstSR() { - return pDUSessionEstSR; - } - - public void setPDUSessionEstSR(int pDUSessionEstSR) { - this.pDUSessionEstSR = pDUSessionEstSR; - } -} +/* + * Copyright (C) 2022 Wipro Limited. All rights reserved. + * + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.usecaseui.server.service.slicingdomain.kpi.bean; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class PDUSessionEstSR { + + private String timeStamp; + + @JsonProperty("pDUSessionEstSR") + private String pDUSessionEstSR; + +} 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 8d0e9db4..41764c33 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 @@ -147,7 +147,7 @@ public class ResourceMonitorServiceConvertTest { List kpiPDUSessionEstSRInfoList = new ArrayList<>(); PDUSessionEstSR kpiPDUSessionEstSRInfo = new PDUSessionEstSR(); - kpiPDUSessionEstSRInfo.setPDUSessionEstSR(100); + kpiPDUSessionEstSRInfo.setPDUSessionEstSR("100"); kpiPDUSessionEstSRInfo.setTimeStamp("2019-12-23 11:31:19"); kpiPDUSessionEstSRInfoList.add(kpiPDUSessionEstSRInfo); kpiPDUSessionEstSR.setResult(kpiPDUSessionEstSRInfoList); diff --git a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSRTest.java b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSRTest.java index 933bcff3..10ca2ba2 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSRTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/KpiPDUSessionEstSRTest.java @@ -40,7 +40,7 @@ class KpiPDUSessionEstSRTest { List pDUSessionEstSRList = new ArrayList<>(); PDUSessionEstSR pDUSessionEstSR = new PDUSessionEstSR(); pDUSessionEstSR.setTimeStamp("12345634456"); - pDUSessionEstSR.setPDUSessionEstSR(123); + pDUSessionEstSR.setPDUSessionEstSR("123"); pDUSessionEstSRList.add(pDUSessionEstSR); kpiPDUSessionEstSR.setResult(pDUSessionEstSRList); diff --git a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSRTest.java b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSRTest.java index 9b2db5d5..3cf51c28 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSRTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/slicingdomain/kpi/bean/PDUSessionEstSRTest.java @@ -33,7 +33,7 @@ public class PDUSessionEstSRTest { public void testSetAndGetPDUSessionEstSR() throws Exception { PDUSessionEstSR pDUSessionEstSR = new PDUSessionEstSR(); pDUSessionEstSR.setTimeStamp("12345634456"); - pDUSessionEstSR.setPDUSessionEstSR(123); + pDUSessionEstSR.setPDUSessionEstSR("123"); pDUSessionEstSR.getTimeStamp(); pDUSessionEstSR.getPDUSessionEstSR();