summaryrefslogtreecommitdiffstats
path: root/components/slice-analysis-ms/src/test/java/org
diff options
context:
space:
mode:
authorNiranjana <niranjana.y60@wipro.com>2022-04-28 14:14:44 +0000
committerNiranjana <niranjana.y60@wipro.com>2022-04-29 15:25:44 +0000
commit111f6428fea584ce6342c84e6c623945b900addd (patch)
treee2ba1f23a0cec033ec08be6ca98a163bd2d40876 /components/slice-analysis-ms/src/test/java/org
parent96bb3070750e59e028ae9d06c368f9a6b2e014a2 (diff)
[SLICEANALYSIS] Filter RAN related service instances in AAI and Fetch CU Cells data for intelligent slicing
Issue-ID: DCAEGEN2-3145 Issue-ID: DCAEGEN2-3146 Signed-off-by: Niranjana <niranjana.y60@wipro.com> Change-Id: I5c53bc05f43de09554b02a763d7f5c22435c9962
Diffstat (limited to 'components/slice-analysis-ms/src/test/java/org')
-rw-r--r--components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/configdb/ConfigDbInterfaceServiceTest.java32
-rw-r--r--components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/MLMessageProcessorTest.java2
2 files changed, 32 insertions, 2 deletions
diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/configdb/ConfigDbInterfaceServiceTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/configdb/ConfigDbInterfaceServiceTest.java
index 885a9171..28e157c8 100644
--- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/configdb/ConfigDbInterfaceServiceTest.java
+++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/configdb/ConfigDbInterfaceServiceTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* slice-analysis-ms
* ================================================================================
- * Copyright (C) 2020-2021 Wipro Limited.
+ * Copyright (C) 2020-2022 Wipro Limited.
* ==============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -126,6 +126,7 @@ public class ConfigDbInterfaceServiceTest {
}
+ @Test
public void fetchServiceProfile() {
Map<String,String> responseMap=new HashMap<String, String>();
responseMap.put("sNSSAI", "001-010");
@@ -136,5 +137,34 @@ public class ConfigDbInterfaceServiceTest {
.thenReturn(new ResponseEntity<Object>(responseMap, HttpStatus.OK));
assertEquals(responseMap, configdbservice.fetchServiceDetails("snssai"));
}
+
+ @Test
+ public void fetchCUCPCellsOfSnssaiTest() {
+ Map<String, List<CellsModel>> response = new HashMap<>();
+ List<CellsModel> cellslist = new ArrayList<>();
+ List<CellsModel> cellslist1 = new ArrayList<>();
+ CellsModel cellsmodel1 = new CellsModel();
+ cellsmodel1.setCellLocalId("1111");
+ CellsModel cellsmodel2 = new CellsModel();
+ cellsmodel2.setCellLocalId("2222");
+ cellslist.add(cellsmodel1);
+ cellslist.add(cellsmodel2);
+ response.put("1", cellslist);
+ CellsModel cellsmodel3 = new CellsModel();
+ cellsmodel3.setCellLocalId("3333");
+ CellsModel cellsmodel4 = new CellsModel();
+ cellsmodel4.setCellLocalId("4444");
+ cellslist1.add(cellsmodel3);
+ cellslist1.add(cellsmodel4);
+ response.put("2", cellslist1);
+ Mockito.when(restclient.sendGetRequest(Mockito.anyString(), Mockito.any()))
+ .thenReturn(new ResponseEntity<Object>(response, HttpStatus.OK));
+ List<String> outputlist = new ArrayList<>();
+ outputlist.add("1111");
+ outputlist.add("2222");
+ Map<String, List<String>> output = configdbservice.fetchCUCPCellsOfSnssai("snssai");
+ assertEquals(outputlist, output.get("1"));
+
+ }
}
diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/MLMessageProcessorTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/MLMessageProcessorTest.java
index 387b5fd0..708ba7e4 100644
--- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/MLMessageProcessorTest.java
+++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/MLMessageProcessorTest.java
@@ -97,7 +97,7 @@ public class MLMessageProcessorTest {
} catch (IOException e) {
e.printStackTrace();
}
- when(configDbService.fetchRICsOfSnssai("0001-0111")).thenReturn(ricToCellMapping);
+ when(configDbService.fetchCUCPCellsOfSnssai("0001-0111")).thenReturn(ricToCellMapping);
AdditionalProperties<MLOutputModel> addProps = new AdditionalProperties<>();
addProps.setResourceConfig(mloutputExp);
doNothing().when(policyService).sendOnsetMessageToPolicy(anyString(), any(AdditionalProperties.class),