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%2FWidgetsCatalogControllerTest.java;h=5daacbdcd241ab4c1d09c08d3b8660f7ab17d409;hb=78c73d16d270ff182057fb797631a270d13c3740;hp=502f0aa1f905e6f40a9759443a45242e9f2cd0da;hpb=be89a5570691d36bf2b8b12035f81d5c85de3e70;p=portal.git diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java index 502f0aa1..5daacbdc 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java @@ -54,7 +54,6 @@ import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.onap.portalapp.portal.controller.WidgetsCatalogController; import org.onap.portalapp.portal.core.MockEPUser; import org.onap.portalapp.portal.domain.EPUser; import org.onap.portalapp.portal.domain.MicroserviceParameter; @@ -65,16 +64,15 @@ 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.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.service.WidgetMService; +import org.onap.portalapp.portal.service.WidgetMServiceImpl; import org.onap.portalapp.portal.service.WidgetParameterService; import org.onap.portalapp.portal.service.WidgetParameterServiceImpl; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.onap.portalapp.util.EPUserUtils; -import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; import org.onap.portalsdk.core.onboarding.util.CipherUtil; import org.onap.portalsdk.core.util.SystemProperties; import org.powermock.api.mockito.PowerMockito; @@ -178,7 +176,7 @@ public class WidgetsCatalogControllerTest { } @Test - public void getWidgetCatalogTest() throws CipherUtilException { + public void getWidgetCatalogTest() throws Exception { PowerMockito.mockStatic(EcompPortalUtils.class); PowerMockito.mockStatic(SystemProperties.class); PowerMockito.mockStatic(EPCommonSystemProperties.class); @@ -353,28 +351,6 @@ public class WidgetsCatalogControllerTest { assertNull(result); } - @SuppressWarnings("unchecked") - @Test - public void getWidgetControllerTest() throws Exception { - PowerMockito.mockStatic(EcompPortalUtils.class); - PowerMockito.mockStatic(SystemProperties.class); - PowerMockito.mockStatic(EPCommonSystemProperties.class); - PowerMockito.mockStatic(CipherUtil.class); - Mockito.when(EcompPortalUtils.widgetMsProtocol()).thenReturn("test1"); - Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL)).thenReturn("https"); - Mockito.when(SystemProperties.getProperty("microservices.widget.local.port")).thenReturn("test"); - Mockito.when(EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user")) - .thenReturn("test"); - Mockito.when(CipherUtil - .decryptPKC(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"))) - .thenReturn("abc"); - Mockito.when(widgetMService.getServiceLocation("widgets-service", "test")).thenReturn("test.com"); - Mockito.when(template.getForObject(Mockito.anyString(), Mockito.any(Class.class), Mockito.any(String.class))) - .thenReturn("test123"); - String result = widgetsCatalogController.getWidgetController(1); - assertNull(result); - } - @SuppressWarnings("unchecked") @Test public void getWidgetCSSTest() throws Exception {