X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=webapp-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FE2ManagerMockConfiguration.java;h=4561dd7e36c80117e762d7bb28e4bf408d73c249;hb=fa50e55b6e8977ad0a6a28096fe58fb54924ca2b;hp=ddec4ae4bf4cfe2ac89224f68199282f5de01a27;hpb=5b686151904e2582ea9ce9d2f1c6abb7a400afa5;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 ddec4ae4..4561dd7e 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 @@ -53,6 +53,8 @@ public class E2ManagerMockConfiguration { private final List nodebIdList; private final GetNodebResponse nodebResponse; + // Simulate remote method delay for UI testing + private final int delayMs = 500; public E2ManagerMockConfiguration() { logger.info("Configuring mock E2 Manager"); @@ -61,7 +63,7 @@ public class E2ManagerMockConfiguration { nodebIdList = new ArrayList<>(); nodebIdList.add(nbid); nodebResponse = new GetNodebResponse().connectionStatus("mockConnectionStatus").failureType("mockFailureType") - .ip("1.2.3.4").nodeType("mockNodeType").port(123).ranName("mockRanName"); + .ip("127.0.0.1").nodeType("mockNodeType").port(123).ranName("mockRanName"); } private ApiClient apiClient() { @@ -76,11 +78,7 @@ public class E2ManagerMockConfiguration { ApiClient apiClient = apiClient(); HealthCheckApi mockApi = mock(HealthCheckApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); - - doAnswer(i -> { - return null; - }).when(mockApi).healthGet(); - + doAnswer(i -> null).when(mockApi).healthGet(); return mockApi; } @@ -90,27 +88,31 @@ public class E2ManagerMockConfiguration { ApiClient apiClient = apiClient(); NodebApi mockApi = mock(NodebApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); - - doAnswer(i -> { + doAnswer(inv -> { + logger.debug("nodebDelete sleeping {}", delayMs); + Thread.sleep(delayMs); return null; }).when(mockApi).nodebDelete(); - - doAnswer(i -> { + doAnswer(inv -> { + logger.debug("getNb sleeping {}", delayMs); + Thread.sleep(delayMs); return nodebResponse; }).when(mockApi).getNb(any(String.class)); - - doAnswer(i -> { + doAnswer(inv -> { + logger.debug("getNodebIdList sleeping {}", delayMs); + Thread.sleep(delayMs); return nodebIdList; }).when(mockApi).getNodebIdList(); - - doAnswer(i -> { + doAnswer(inv -> { + logger.debug("endcSetup sleeping {}", delayMs); + Thread.sleep(delayMs); return null; }).when(mockApi).endcSetup(any(SetupRequest.class)); - - doAnswer(i -> { + doAnswer(inv -> { + logger.debug("x2Setup sleeping {}", delayMs); + Thread.sleep(delayMs); return null; }).when(mockApi).x2Setup(any(SetupRequest.class)); - return mockApi; }