Add portal property; correct docker build script.
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / controller / MicroserviceController.java
index bc21dd9..42a62b5 100644 (file)
@@ -33,6 +33,7 @@ import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
 import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
 import org.openecomp.portalapp.portal.service.ConsulHealthService;
 import org.openecomp.portalapp.portal.service.MicroserviceService;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
 import org.openecomp.portalsdk.core.util.SystemProperties;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
@@ -54,8 +55,6 @@ import org.springframework.web.client.RestTemplate;
 @EPAuditLog
 public class MicroserviceController extends EPRestrictedBaseController {
        
-       private static final String HTTPS = "https://";
-       
        String whatService = "widgets-service";
        RestTemplate template = new RestTemplate();
 
@@ -64,7 +63,7 @@ public class MicroserviceController extends EPRestrictedBaseController {
 
        @Autowired
        private MicroserviceService microserviceService;
-       
+
        @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
        public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
                        @RequestBody MicroserviceData newServiceData) throws Exception {
@@ -114,7 +113,7 @@ public class MicroserviceController extends EPRestrictedBaseController {
                        };
                        // If this service is assoicated with widgets, cannnot be deleted
                        ResponseEntity<List<WidgetCatalog>> ans = (ResponseEntity<List<WidgetCatalog>>) 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/" + serviceId,
                                        HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef);
                        List<WidgetCatalog> widgets = ans.getBody();