diff options
Diffstat (limited to 'components/slice-analysis-ms/src/test/java/org/onap/slice/analysis')
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), |