X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FE2ManagerMockConfiguration.java;h=a03b33e5899206e91822ebcb81f7a12f2c04e19d;hb=b7c9d29d2b472e63bbe0331a413da0e7cd492aee;hp=b05d817495c062067bb39260877128b71b02f133;hpb=0b44138e09b41a42ee1f87afd39616478911dde5;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java index b05d8174..a03b33e5 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java @@ -49,7 +49,7 @@ public class E2ManagerMockConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final GetNodebResponse nodebResponse; - + public E2ManagerMockConfiguration() { logger.info("Configuring mock E2 Manager"); nodebResponse = new GetNodebResponse().ip("1.2.3.4").port(123).ranName("myRan"); @@ -62,7 +62,8 @@ public class E2ManagerMockConfiguration { } @Bean - public HealthCheckApi e2HealthCheckApi() { + // Use the same name as regular configuration + public HealthCheckApi e2MgrHealthCheckApi() { ApiClient apiClient = apiClient(); HealthCheckApi mockApi = mock(HealthCheckApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); @@ -75,11 +76,16 @@ public class E2ManagerMockConfiguration { } @Bean - public NodebApi e2NodebApi() { + // Use the same name as regular configuration + public NodebApi e2MgrNodebApi() { ApiClient apiClient = apiClient(); NodebApi mockApi = mock(NodebApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); + doAnswer(i -> { + return null; + }).when(mockApi).nodebDelete(); + doAnswer(i -> { return nodebResponse; }).when(mockApi).getNb(any(String.class));