X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fcontroller%2FMicroserviceControllerTest.java;h=bea9061533d0a16ab68ca52094d7bec1e6b1288f;hb=ace89e59c9838b666ddd02c08fd5e39a94eee39a;hp=81e1f8b2776c0e295f030a858254c5e1ada0b5b0;hpb=37ea104d5c99b4100381cc0e8e79be3feb98a0ec;p=portal.git diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java index 81e1f8b2..bea90615 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java @@ -59,8 +59,8 @@ import org.onap.portalapp.portal.domain.WidgetServiceHeaders; import org.onap.portalapp.portal.ecomp.model.PortalRestResponse; import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; import org.onap.portalapp.portal.framework.MockitoTestSuite; -import org.onap.portalapp.portal.service.ConsulHealthService; -import org.onap.portalapp.portal.service.ConsulHealthServiceImpl; +import org.onap.portalapp.portal.service.WidgetMService; +import org.onap.portalapp.portal.service.WidgetMServiceImpl; import org.onap.portalapp.portal.service.MicroserviceService; import org.onap.portalapp.portal.service.MicroserviceServiceImpl; import org.onap.portalapp.portal.utils.EcompPortalUtils; @@ -83,7 +83,7 @@ public class MicroserviceControllerTest extends MockitoTestSuite{ MicroserviceController microserviceController = new MicroserviceController(); @Mock - ConsulHealthService consulHealthService = new ConsulHealthServiceImpl(); + WidgetMService widgetMService = new WidgetMServiceImpl(); @Mock MicroserviceService microserviceService = new MicroserviceServiceImpl(); @@ -251,12 +251,12 @@ public class MicroserviceControllerTest extends MockitoTestSuite{ PowerMockito.mockStatic(WidgetServiceHeaders.class); PowerMockito.mockStatic(EcompPortalUtils.class); String whatService = "widgets-service"; - Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test"); + Mockito.when(widgetMService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test"); Mockito.when(ans.getBody()).thenReturn(List); ParameterizedTypeReference> typeRef = new ParameterizedTypeReference>() { }; Mockito.when(template.exchange( - org.onap.portalapp.portal.utils.EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + org.onap.portalapp.portal.utils.EcompPortalUtils.widgetMsProtocol() + "://" + widgetMService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + "/widget/microservices/widgetCatalog/service/" + 1, HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans); @@ -276,12 +276,12 @@ public class MicroserviceControllerTest extends MockitoTestSuite{ PowerMockito.mockStatic(WidgetServiceHeaders.class); PowerMockito.mockStatic(EcompPortalUtils.class); String whatService = "widgets-service"; - Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test"); + Mockito.when(widgetMService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test"); Mockito.when(ans.getBody()).thenReturn(List); ParameterizedTypeReference> typeRef = new ParameterizedTypeReference>() { }; Mockito.when(template.exchange( - org.onap.portalapp.portal.utils.EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + org.onap.portalapp.portal.utils.EcompPortalUtils.widgetMsProtocol() + "://" + widgetMService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + "/widget/microservices/widgetCatalog/service/" + 1, HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans); PortalRestResponse actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,