diff options
author | 2022-09-14 12:05:19 +0800 | |
---|---|---|
committer | 2022-09-20 23:14:48 +0800 | |
commit | f5db5bd223d369a1186c94f43ab642e9c4d69709 (patch) | |
tree | 1acf6e5cdeff298622d6f6fad8c1431d0e90b43a /components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap | |
parent | 3a0de968e2c5a32a2fa43f791c78455db1c3e641 (diff) |
[SLICEMS] Add bw decrease logics and enhance runtime config feature
Add closed loop assurance decrease bw logics. Add a thread transfers
latest data from cbs client configs to corresponding value. Add runtime
configuration function. Fix the bug that cll service info didn't get updated when a cll service is deleted.
Issue-ID: DCAEGEN2-3240
Issue-ID: DCAEGEN2-3264
Issue-ID: DCAEGEN2-3255
Issue-ID: DCAEGEN2-3238
Signed-off-by: qingshuting <qingshuting1@huawei.com>
Change-Id: Id611d10973fca1e1715e9e220819dfcf51bbd1ba
Diffstat (limited to 'components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap')
2 files changed, 23 insertions, 1 deletions
diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallbackTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallbackTest.java index 16745193..9fce12f1 100644 --- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallbackTest.java +++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallbackTest.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2022 Huawei Canada Limited. * Copyright (C) 2022 CTC, Inc. + * Copyright (C) 2022 Huawei Technologies Co., Ltd. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +84,8 @@ public class AaiEventNotificationCallbackTest { jsonObject.addProperty("sliceanalysisms.vesNotifChangeType", "1"); jsonObject.addProperty("sliceanalysisms.vesNotifPollingInterval", "1"); jsonObject.addProperty("sliceanalysisms.ccvpnEvalInterval", "1"); - jsonObject.addProperty("sliceanalysisms.ccvpnEvalThreshold", "1"); + jsonObject.addProperty("sliceanalysisms.ccvpnEvalUpperThreshold", "1"); + jsonObject.addProperty("sliceanalysisms.ccvpnEvalLowerThreshold", "1"); jsonObject.addProperty("sliceanalysisms.ccvpnEvalPrecision", "1"); jsonObject.addProperty("sliceanalysisms.ccvpnEvalPeriodicCheckOn", "1"); jsonObject.addProperty("sliceanalysisms.ccvpnEvalOnDemandCheckOn", "1"); diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallbackTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallbackTest.java index 74f75a8c..97ee9fa9 100644 --- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallbackTest.java +++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallbackTest.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2020 Wipro Limited. * Copyright (C) 2022 Huawei Canada Limited. + * Copyright (C) 2022 Huawei Technologies Co., Ltd. * ============================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +23,20 @@ package org.onap.slice.analysis.ms.dmaap; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashSet; +import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; +import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; +import org.onap.slice.analysis.ms.aai.AaiService; +import org.onap.slice.analysis.ms.service.ccvpn.CCVPNPmDatastore; +import org.powermock.api.mockito.PowerMockito; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; @@ -39,6 +48,12 @@ import java.nio.file.Paths; public class VesNotificationCallbackTest { ObjectMapper obj = new ObjectMapper(); + @Mock + AaiService aaiService; + + @Mock + CCVPNPmDatastore ccvpnPmDatastore; + @Spy @InjectMocks VesNotificationCallback vesNotificationCallback; @@ -57,6 +72,11 @@ public class VesNotificationCallbackTest { } catch (IOException e) { e.printStackTrace(); } + Set<String> cllInstances = new HashSet<>(); + cllInstances.add("cll-01"); + cllInstances.add("cll-02"); + Mockito.when(aaiService.fetchAllCllInstances()).thenReturn(cllInstances); + Mockito.doNothing().when(ccvpnPmDatastore).updateCllInstances(Mockito.any()); vesNotificationCallback.activateCallBack(input); Mockito.verify(vesNotificationCallback, Mockito.atLeastOnce()).activateCallBack(Mockito.anyString()); } |