summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common-test/src
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-BE-common-test/src')
-rw-r--r--ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/MicroserviceControllerTest.java5
-rw-r--r--ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/WidgetsCatalogMarkupControllerTest.java3
2 files changed, 4 insertions, 4 deletions
diff --git a/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/MicroserviceControllerTest.java b/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/MicroserviceControllerTest.java
index 4c14d8a0..567446ee 100644
--- a/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/MicroserviceControllerTest.java
+++ b/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/MicroserviceControllerTest.java
@@ -165,7 +165,7 @@ public class MicroserviceControllerTest extends MockitoTestSuite{
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("FAILURE");
expectedportalRestResponse.setResponse(
- "I/O error on GET request for \"https://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
+ "I/O error on GET request for \"" + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
PortalRestStatusEnum portalRestStatusEnum = null;
expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
PowerMockito.mockStatic(WidgetServiceHeaders.class);
@@ -209,7 +209,6 @@ public class MicroserviceControllerTest extends MockitoTestSuite{
@SuppressWarnings("unchecked")
@Test
public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
- String HTTPS = "https://";
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("SUCCESS");
expectedportalRestResponse.setResponse("");
@@ -223,7 +222,7 @@ public class MicroserviceControllerTest extends MockitoTestSuite{
ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
};
Mockito.when(template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/service/" + 1,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
diff --git a/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/WidgetsCatalogMarkupControllerTest.java b/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/WidgetsCatalogMarkupControllerTest.java
index 1ba4c784..60a9b7a1 100644
--- a/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/WidgetsCatalogMarkupControllerTest.java
+++ b/ecomp-portal-BE-common-test/src/main/java/org/openecomp/portalapp/portal/test/controller/WidgetsCatalogMarkupControllerTest.java
@@ -19,6 +19,7 @@ import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalsdk.core.util.SystemProperties;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -62,7 +63,7 @@ public class WidgetsCatalogMarkupControllerTest extends MockitoTestSuite {
{
String whatService = "widgets-service";
PowerMockito.mockStatic(WidgetServiceHeaders.class);
- Mockito.when(template.getForObject("https://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
+ Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
WidgetServiceHeaders.getInstance())).thenReturn("Success");
String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
assertTrue(response.equals("Success"));