X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fconfig%2FAppManagerMockConfiguration.java;h=6b0517e81123c41d2c1f01d3f77098735d722d96;hb=53f1fcf033e3a166d7203e0a1c5e0971f9c6bc16;hp=ba84fd4fa5ca91d15df369d7f9c28be848d8c7cc;hpb=6dd828008e1c553b5b4ac6e45af0ccf73c2ed92e;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AppManagerMockConfiguration.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AppManagerMockConfiguration.java index ba84fd4f..6b0517e8 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AppManagerMockConfiguration.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/AppManagerMockConfiguration.java @@ -88,9 +88,7 @@ public class AppManagerMockConfiguration { subRes = new SubscriptionResponse().eventType(SubscriptionResponse.EventTypeEnum.ALL).id("subid").version(1); } - @Bean - // Use the same name as regular configuration - public HealthApi xappMgrHealthApi() { + private HealthApi healthApi() { ApiClient mockClient = mock(ApiClient.class); when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK); HealthApi mockApi = mock(HealthApi.class); @@ -100,9 +98,7 @@ public class AppManagerMockConfiguration { return mockApi; } - @Bean - // Use the same name as regular configuration - public XappApi xappMgrXappApi() { + private XappApi xappApi() { ApiClient mockClient = mock(ApiClient.class); when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK); XappApi mockApi = mock(XappApi.class); @@ -187,4 +183,15 @@ public class AppManagerMockConfiguration { return mockApi; } + @Bean + // Must use the same name as the non-mock configuration + public AppManagerApiBuilder appManagerApiBuilder() { + final AppManagerApiBuilder mockBuilder = mock(AppManagerApiBuilder.class); + final HealthApi mockHealthApi = healthApi(); + when(mockBuilder.getHealthApi(any(String.class))).thenReturn(mockHealthApi); + final XappApi mockXappApi = xappApi(); + when(mockBuilder.getXappApi(any(String.class))).thenReturn(mockXappApi); + return mockBuilder; + } + }