diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
new file mode 100644
index 0000000..80144d8
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GenericStringConverter.java
@@ -0,0 +1,33 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import java.util.Set;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.core.convert.converter.GenericConverter;
+import org.springframework.stereotype.Component;
+import com.google.common.collect.ImmutableSet;
+
+@Component
+@ConfigurationPropertiesBinding
+public class GenericStringConverter implements GenericConverter {
+
+    @Autowired
+    private HealthCheckConverter converter;
+
+    @Override
+    public Set<ConvertiblePair> getConvertibleTypes() {
+
+        ConvertiblePair[] pairs = new ConvertiblePair[] {new ConvertiblePair(String.class, Subsystem.class),
+                new ConvertiblePair(String.class, URI.class)};
+        return ImmutableSet.copyOf(pairs);
+    }
+
+    @Override
+    public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+
+        return converter.convert(source, sourceType, targetType);
+
+    }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
index 3d4b2c7..0379ae3 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
@@ -25,11 +25,8 @@
 
 import java.net.URI;
 import java.util.Collections;
-import org.onap.so.logger.LoggingAnchor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
+import java.util.List;
+import java.util.stream.Collectors;
 import javax.annotation.PostConstruct;
 import javax.transaction.Transactional;
 import javax.ws.rs.DefaultValue;
@@ -42,14 +39,20 @@
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import org.apache.http.HttpStatus;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.onap.so.logger.LoggingAnchor;
 import org.onap.so.logger.MessageEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
-import org.springframework.http.HttpMethod;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -59,45 +62,38 @@
 @Api(value = "/globalhealthcheck", description = "APIH Infra Global Health Check")
 public class GlobalHealthcheckHandler {
     private static Logger logger = LoggerFactory.getLogger(GlobalHealthcheckHandler.class);
-    private static final String CONTEXTPATH_PROPERTY = "management.context-path";
-    private static final String PROPERTY_DOMAIN = "mso.health.endpoints";
-    private static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".catalogdb";
-    private static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".requestdb";
-    private static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".sdnc";
-    private static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".openstack";
-    private static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".bpmn";
-    private static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".asdc";
-    private static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".requestdbattsvc";
-    private static final String DEFAULT_PROPERTY_VALUE = "";
+    protected static final String CONTEXTPATH_PROPERTY = "management.endpoints.web.base-path";
+    protected static final String PROPERTY_DOMAIN = "mso.health";
+    protected static final String CATALOGDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.catalogdb";
+    protected static final String REQUESTDB_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdb";
+    protected static final String SDNC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.sdnc";
+    protected static final String OPENSTACK_PROPERTY = PROPERTY_DOMAIN + ".endpoints.openstack";
+    protected static final String BPMN_PROPERTY = PROPERTY_DOMAIN + ".endpoints.bpmn";
+    protected static final String ASDC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.asdc";
+    protected static final String REQUESTDBATTSVC_PROPERTY = PROPERTY_DOMAIN + ".endpoints.requestdbattsvc";
+    protected static final String MSO_AUTH_PROPERTY = PROPERTY_DOMAIN + ".auth";
+    protected static final String DEFAULT_PROPERTY_VALUE = "";
 
     // e.g. /manage
     private String actuatorContextPath;
-    private String endpointCatalogdb;
-    private String endpointRequestdb;
-    private String endpointSdnc;
-    private String endpointOpenstack;
-    private String endpointBpmn;
-    private String endpointAsdc;
-    private String endpointRequestdbAttsvc;
 
     @Autowired
     private Environment env;
 
     @Autowired
     private RestTemplate restTemplate;
-    private final String health = "/health";
 
+    @Autowired
+    private HealthCheckConfig config;
+
+    private static final String HEALTH = "/health";
+
+    private String msoAuth;
 
     @PostConstruct
     protected void init() {
         actuatorContextPath = env.getProperty(CONTEXTPATH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointCatalogdb = env.getProperty(CATALOGDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointRequestdb = env.getProperty(REQUESTDB_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointSdnc = env.getProperty(SDNC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointOpenstack = env.getProperty(OPENSTACK_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointBpmn = env.getProperty(BPMN_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointAsdc = env.getProperty(ASDC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
-        endpointRequestdbAttsvc = env.getProperty(REQUESTDBATTSVC_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
+        msoAuth = env.getProperty(MSO_AUTH_PROPERTY, String.class, DEFAULT_PROPERTY_VALUE);
     }
 
     @GET
@@ -108,29 +104,25 @@
             @Context ContainerRequestContext requestContext) {
         Response HEALTH_CHECK_RESPONSE = null;
         // Build internal response object
-        HealthcheckResponse rsp = new HealthcheckResponse();
+        HealthCheckResponse rsp = new HealthCheckResponse();
 
         try {
             // Generated RequestId
             String requestId = requestContext.getProperty("requestId").toString();
             logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
 
-            // set APIH status, this is the main entry point
-            rsp.setApih(HealthcheckStatus.UP.toString());
-            // set BPMN
-            rsp.setBpmn(querySubsystemHealth(MsoSubsystems.BPMN));
-            // set SDNCAdapter
-            rsp.setSdncAdapter(querySubsystemHealth(MsoSubsystems.SDNC));
-            // set ASDCController
-            rsp.setAsdcController(querySubsystemHealth(MsoSubsystems.ASDC));
-            // set CatalogDbAdapter
-            rsp.setCatalogdbAdapter(querySubsystemHealth(MsoSubsystems.CATALOGDB));
-            // set RequestDbAdapter
-            rsp.setRequestdbAdapter(querySubsystemHealth(MsoSubsystems.REQUESTDB));
-            // set OpenStackAdapter
-            rsp.setOpenstackAdapter(querySubsystemHealth(MsoSubsystems.OPENSTACK));
-            // set RequestDbAdapterAttSvc
-            rsp.setRequestdbAdapterAttsvc(querySubsystemHealth(MsoSubsystems.REQUESTDBATT));
+            List<Endpoint> endpoints = config.getEndpoints().stream().filter(item -> {
+                if (!enableBpmn && SoSubsystems.BPMN.equals(item.getSubsystem())) {
+                    return false;
+                } else {
+                    return true;
+                }
+            }).collect(Collectors.toList());
+
+            for (Endpoint endpoint : endpoints) {
+                rsp.getSubsystems().add(querySubsystemHealth(endpoint));
+            }
+
             // set Message
             rsp.setMessage(String.format("HttpStatus: %s", HttpStatus.SC_OK));
             logger.info(rsp.toString());
@@ -149,70 +141,51 @@
     protected HttpEntity<String> buildHttpEntityForRequest() {
         HttpHeaders headers = new HttpHeaders();
         headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
-        headers.set("Content-Type", "application/json");
+        headers.set(HttpHeaders.CONTENT_TYPE, "application/json");
+        headers.set(HttpHeaders.AUTHORIZATION, msoAuth);
         HttpEntity<String> entity = new HttpEntity<>("parameters", headers);
         return entity;
     }
 
-    protected String querySubsystemHealth(MsoSubsystems subsystem) {
+    protected HealthCheckSubsystem querySubsystemHealth(Endpoint subsystem) {
+        HealthCheckStatus status = HealthCheckStatus.DOWN;
+        URI uri = subsystem.getUri();
         try {
             // get port number for the subsystem
-            String ept = getEndpointUrlForSubsystemEnum(subsystem);
-
             // build final endpoint url
-            UriBuilder builder = UriBuilder.fromPath(ept).path(actuatorContextPath).path(health);
-            URI uri = builder.build();
-            logger.info("Calculated URL: {}", uri.toString());
+            uri = UriBuilder.fromUri(subsystem.getUri()).path(actuatorContextPath).path(HEALTH).build();
+            logger.info("Calculated URL: {}", uri);
 
             ResponseEntity<SubsystemHealthcheckResponse> result = restTemplate.exchange(uri, HttpMethod.GET,
                     buildHttpEntityForRequest(), SubsystemHealthcheckResponse.class);
 
-            return processResponseFromSubsystem(result, subsystem);
+            status = processResponseFromSubsystem(result, subsystem);
+
 
         } catch (Exception ex) {
             logger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() ", ex);
-            return HealthcheckStatus.DOWN.toString();
         }
+
+        return new HealthCheckSubsystem(subsystem.getSubsystem(), uri, status);
     }
 
-    protected String processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
-            MsoSubsystems subsystem) {
+    protected HealthCheckStatus processResponseFromSubsystem(ResponseEntity<SubsystemHealthcheckResponse> result,
+            Endpoint endpoint) {
         if (result == null || result.getStatusCodeValue() != HttpStatus.SC_OK) {
             logger.error(String.format("Globalhealthcheck: checking subsystem: %s failed ! result object is: %s",
-                    subsystem, result == null ? "NULL" : result));
-            return HealthcheckStatus.DOWN.toString();
+                    endpoint.getSubsystem(), result == null ? "NULL" : result));
+            return HealthCheckStatus.DOWN;
         }
 
         SubsystemHealthcheckResponse body = result.getBody();
 
         String status = body.getStatus();
         if ("UP".equalsIgnoreCase(status)) {
-            return HealthcheckStatus.UP.toString();
+            return HealthCheckStatus.UP;
         } else {
-            logger.error("{}, query health endpoint did not return UP status!", subsystem);
-            return HealthcheckStatus.DOWN.toString();
+            logger.error("{}, query health endpoint did not return UP status!", endpoint.getSubsystem());
+            return HealthCheckStatus.DOWN;
         }
     }
 
-
-    protected String getEndpointUrlForSubsystemEnum(MsoSubsystems subsystem) {
-        switch (subsystem) {
-            case SDNC:
-                return this.endpointSdnc;
-            case ASDC:
-                return this.endpointAsdc;
-            case BPMN:
-                return this.endpointBpmn;
-            case CATALOGDB:
-                return this.endpointCatalogdb;
-            case OPENSTACK:
-                return this.endpointOpenstack;
-            case REQUESTDB:
-                return this.endpointRequestdb;
-            case REQUESTDBATT:
-                return this.endpointRequestdbAttsvc;
-            default:
-                return "";
-        }
-    }
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
new file mode 100644
index 0000000..1899cdd
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheck.java
@@ -0,0 +1,84 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health.enpoints")
+public class HealthCheck {
+
+    private Subsystem subsystem;
+    private URI uri;
+    private HealthCheckStatus status = HealthCheckStatus.DOWN;
+
+    public HealthCheck() {
+
+    }
+
+    public HealthCheck(String subsystem, String uri) {
+        this.subsystem = SoSubsystems.valueOf(subsystem.toUpperCase());
+        this.uri = UriBuilder.fromUri(uri).build();
+    }
+
+    public HealthCheck(Subsystem subsystem, URI uri) {
+        this.subsystem = subsystem;
+        this.uri = uri;
+    }
+
+    public HealthCheck(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+        this.subsystem = subsystem;
+        this.uri = uri;
+        this.status = status;
+    }
+
+    public Subsystem getSubsystem() {
+        return subsystem;
+    }
+
+    public void setSubsystem(Subsystem component) {
+        this.subsystem = component;
+    }
+
+    public URI getUri() {
+        return uri;
+    }
+
+    public void setUri(URI uri) {
+        this.uri = uri;
+    }
+
+    public HealthCheckStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(HealthCheckStatus status) {
+        this.status = status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this).append("subsystem", subsystem).append("uri", uri).append("status", status)
+                .toString();
+    }
+
+    @Override
+    public boolean equals(final Object other) {
+        if (!(other instanceof HealthCheck)) {
+            return false;
+        }
+        HealthCheck castOther = (HealthCheck) other;
+        return new EqualsBuilder().append(subsystem, castOther.subsystem).append(uri, castOther.uri)
+                .append(status, castOther.status).isEquals();
+    }
+
+    @Override
+    public int hashCode() {
+        return new HashCodeBuilder().append(subsystem).append(uri).append(status).toHashCode();
+    }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
new file mode 100644
index 0000000..11fd94b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConfig.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.validation.annotation.Validated;
+
+@Configuration
+@ConfigurationProperties(prefix = "mso.health")
+@Validated
+public class HealthCheckConfig {
+
+    @NotNull
+    private List<Endpoint> endpoints;
+
+    public List<Endpoint> getEndpoints() {
+        return endpoints;
+    }
+
+    public void setEndpoints(List<Endpoint> endpoints) {
+        this.endpoints = endpoints;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this).append("endpoints", this.endpoints).toString();
+    }
+
+    @Validated
+    public static class Endpoint {
+        @NotNull
+        private Subsystem subsystem;
+        @NotNull
+        private URI uri;
+
+        public Endpoint() {
+
+        }
+
+        public Endpoint(Subsystem subsystem, URI uri) {
+            this.subsystem = subsystem;
+            this.uri = uri;
+        }
+
+        public Subsystem getSubsystem() {
+            return subsystem;
+        }
+
+        public void setSubsystem(Subsystem subsystem) {
+            this.subsystem = subsystem;
+        }
+
+        public URI getUri() {
+            return uri;
+        }
+
+        public void setUri(URI uri) {
+            this.uri = uri;
+        }
+    }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
new file mode 100644
index 0000000..ed06018
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckConverter.java
@@ -0,0 +1,22 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.springframework.core.convert.TypeDescriptor;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HealthCheckConverter {
+
+
+    public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
+        if (sourceType.getType() == String.class && targetType.getType() == Subsystem.class) {
+            return SoSubsystems.valueOf(((String) source).toUpperCase());
+        } else if (sourceType.getType() == String.class && targetType.getType() == URI.class) {
+            return UriBuilder.fromUri((String) source).build();
+        } else {
+            return source;
+        }
+    }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
similarity index 66%
copy from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
copy to mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
index 13f1e52..5400249 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckResponse.java
@@ -19,25 +19,31 @@
  */
 package org.onap.so.apihandlerinfra;
 
-public enum MsoSubsystems {
-    APIH("API Handler"),
-    ASDC("ASDC Controller"),
-    BPMN("BPMN Infra"),
-    CATALOGDB("CatalogDb Adapter"),
-    OPENSTACK("Openstack Adapter"),
-    REQUESTDB("RequestDB Adapter"),
-    REQUESTDBATT("RequestDB Adapter ATT Svc"),
-    SDNC("SDNC Adapter");
-    private String subsystem;
+import java.util.ArrayList;
+import java.util.List;
 
-    private MsoSubsystems(String subsystem) {
-        this.subsystem = subsystem;
+public class HealthCheckResponse {
+
+
+    private List<HealthCheckSubsystem> subsystems = new ArrayList<>();
+    private String message;
+
+
+    public List<HealthCheckSubsystem> getSubsystems() {
+        return subsystems;
     }
 
-    @Override
-    public String toString() {
-        return subsystem;
+    public void setSubsystems(List<HealthCheckSubsystem> subsystems) {
+        this.subsystems = subsystems;
     }
 
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+
 }
-
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
similarity index 93%
rename from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java
rename to mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
index 077a3c2..6b31c1f 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckStatus.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckStatus.java
@@ -19,12 +19,12 @@
  */
 package org.onap.so.apihandlerinfra;
 
-public enum HealthcheckStatus {
+public enum HealthCheckStatus {
     UP("UP"), DOWN("DOWN");
 
     private String status;
 
-    private HealthcheckStatus(String status) {
+    private HealthCheckStatus(String status) {
         this.status = status;
     }
 
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
new file mode 100644
index 0000000..e1335b9
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthCheckSubsystem.java
@@ -0,0 +1,40 @@
+package org.onap.so.apihandlerinfra;
+
+import java.net.URI;
+
+public class HealthCheckSubsystem {
+
+    private Subsystem subsystem;
+    private URI uri;
+    private HealthCheckStatus status;
+
+    public HealthCheckSubsystem(Subsystem subsystem, URI uri, HealthCheckStatus status) {
+        this.subsystem = subsystem;
+        this.uri = uri;
+        this.status = status;
+    }
+
+    public Subsystem getSubsystem() {
+        return subsystem;
+    }
+
+    public void setSubsystem(Subsystem subsystem) {
+        this.subsystem = subsystem;
+    }
+
+    public URI getUri() {
+        return uri;
+    }
+
+    public void setUri(URI uri) {
+        this.uri = uri;
+    }
+
+    public HealthCheckStatus getStatus() {
+        return status;
+    }
+
+    public void setStatus(HealthCheckStatus status) {
+        this.status = status;
+    }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
deleted file mode 100644
index fad3dd4..0000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/HealthcheckResponse.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.apihandlerinfra;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-public class HealthcheckResponse {
-    private String apih;
-    private String bpmn;
-    private String sdncAdapter;
-    private String asdcController;
-    private String catalogdbAdapter;
-    private String requestdbAdapter;
-    private String openstackAdapter;
-    private String requestdbAdapterAttsvc;
-    private String message = "";
-
-    public String getApih() {
-        return apih;
-    }
-
-    public void setApih(String apih) {
-        this.apih = apih;
-    }
-
-    public String getBpmn() {
-        return bpmn;
-    }
-
-    public void setBpmn(String bpmn) {
-        this.bpmn = bpmn;
-    }
-
-    public String getSdncAdapter() {
-        return sdncAdapter;
-    }
-
-    public void setSdncAdapter(String sdncAdapter) {
-        this.sdncAdapter = sdncAdapter;
-    }
-
-    public String getAsdcController() {
-        return asdcController;
-    }
-
-    public void setAsdcController(String asdcController) {
-        this.asdcController = asdcController;
-    }
-
-    public String getCatalogdbAdapter() {
-        return catalogdbAdapter;
-    }
-
-    public void setCatalogdbAdapter(String catalogdbAdapter) {
-        this.catalogdbAdapter = catalogdbAdapter;
-    }
-
-    public String getRequestdbAdapter() {
-        return requestdbAdapter;
-    }
-
-    public void setRequestdbAdapter(String requestdbAdapter) {
-        this.requestdbAdapter = requestdbAdapter;
-    }
-
-    public String getOpenstackAdapter() {
-        return openstackAdapter;
-    }
-
-    public void setOpenstackAdapter(String openstackAdapter) {
-        this.openstackAdapter = openstackAdapter;
-    }
-
-    public String getRequestdbAdapterAttsvc() {
-        return requestdbAdapterAttsvc;
-    }
-
-    public void setRequestdbAdapterAttsvc(String requestdbAdapterAttsvc) {
-        this.requestdbAdapterAttsvc = requestdbAdapterAttsvc;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this).append("apih", this.apih).append("pbmn", this.bpmn)
-                .append("sdncAdapter", this.sdncAdapter).append("asdcController", this.asdcController)
-                .append("catalogdbAdapter", this.catalogdbAdapter).append("requestdbAdapter", this.requestdbAdapter)
-                .append("openstackAdapter", this.openstackAdapter)
-                .append("requestdbAdapterAttsvc", this.requestdbAdapterAttsvc).append("message", this.message)
-                .toString();
-    }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
similarity index 92%
rename from mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
rename to mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
index 13f1e52..5842531 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoSubsystems.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/SoSubsystems.java
@@ -19,18 +19,18 @@
  */
 package org.onap.so.apihandlerinfra;
 
-public enum MsoSubsystems {
+public enum SoSubsystems implements Subsystem {
     APIH("API Handler"),
     ASDC("ASDC Controller"),
     BPMN("BPMN Infra"),
     CATALOGDB("CatalogDb Adapter"),
     OPENSTACK("Openstack Adapter"),
     REQUESTDB("RequestDB Adapter"),
-    REQUESTDBATT("RequestDB Adapter ATT Svc"),
     SDNC("SDNC Adapter");
+
     private String subsystem;
 
-    private MsoSubsystems(String subsystem) {
+    private SoSubsystems(String subsystem) {
         this.subsystem = subsystem;
     }
 
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
new file mode 100644
index 0000000..88626f3
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/Subsystem.java
@@ -0,0 +1,5 @@
+package org.onap.so.apihandlerinfra;
+
+public interface Subsystem {
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
index 928b488..0291cfd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java
@@ -20,70 +20,67 @@
 
 package org.onap.so.apihandlerinfra;
 
-import static org.junit.Assert.assertArrayEquals;
+import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyObject;
+import static org.junit.Assert.assertThat;
 import static org.mockito.ArgumentMatchers.anyString;
 import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import org.springframework.test.util.ReflectionTestUtils;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
-import org.springframework.core.ParameterizedTypeReference;
+import org.json.JSONException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentMatchers;
+import org.mockito.Mockito;
+import org.onap.so.apihandlerinfra.HealthCheckConfig.Endpoint;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.boot.test.mock.mockito.SpyBean;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
-import org.json.JSONException;
-import org.junit.Rule;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.ArgumentMatchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.Spy;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
 import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.util.ReflectionTestUtils;
 import org.springframework.web.client.RestTemplate;
+import com.fasterxml.jackson.core.JsonProcessingException;
 
 
+@RunWith(SpringRunner.class)
+@ContextConfiguration(classes = {GenericStringConverter.class, HealthCheckConverter.class},
+        initializers = {ConfigFileApplicationContextInitializer.class})
+@ActiveProfiles("test")
+@EnableConfigurationProperties({HealthCheckConfig.class})
 public class GlobalHealthcheckHandlerTest {
-    @Mock
-    RestTemplate restTemplate;
+    @MockBean
+    private RestTemplate restTemplate;
 
-    @Mock
-    ContainerRequestContext requestContext;
+    @MockBean
+    private ContainerRequestContext requestContext;
 
-    @InjectMocks
-    @Spy
-    GlobalHealthcheckHandler globalhealth;
-
-    @Rule
-    public MockitoRule mockitoRule = MockitoJUnit.rule();
+    @SpyBean
+    private GlobalHealthcheckHandler globalhealth;
 
     @Test
     public void testQuerySubsystemHealthNullResult() {
         ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
-        ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8080");
 
         Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
                 ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(null);
 
-        String result = globalhealth.querySubsystemHealth(MsoSubsystems.BPMN);
-        System.out.println(result);
-        assertEquals(HealthcheckStatus.DOWN.toString(), result);
+        HealthCheckSubsystem result = globalhealth
+                .querySubsystemHealth(new Endpoint(SoSubsystems.BPMN, UriBuilder.fromPath("http://localhost").build()));
+        assertEquals(HealthCheckStatus.DOWN, result.getStatus());
     }
 
     @Test
     public void testQuerySubsystemHealthNotNullResult() {
         ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
-        ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
 
         SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
         subSystemResponse.setStatus("UP");
@@ -92,20 +89,13 @@
         Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), ArgumentMatchers.any(HttpMethod.class),
                 ArgumentMatchers.<HttpEntity<?>>any(), ArgumentMatchers.<Class<Object>>any())).thenReturn(r);
 
-        String result = globalhealth.querySubsystemHealth(MsoSubsystems.ASDC);
-        System.out.println(result);
-        assertEquals(HealthcheckStatus.UP.toString(), result);
+        HealthCheckSubsystem result = globalhealth
+                .querySubsystemHealth(new Endpoint(SoSubsystems.ASDC, UriBuilder.fromPath("http://localhost").build()));
+        assertEquals(HealthCheckStatus.UP, result.getStatus());
     }
 
     private Response globalHealthcheck(String status) {
         ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
-        ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
-        ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
-        ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
-        ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
-        ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
-        ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
-        ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
 
         SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
 
@@ -116,70 +106,41 @@
 
         Mockito.when(requestContext.getProperty(anyString())).thenReturn("1234567890");
         Response response = globalhealth.globalHealthcheck(true, requestContext);
-
         return response;
     }
 
     @Test
-    public void globalHealthcheckAllUPTest() throws JSONException {
+    public void globalHealthcheckAllUPTest() throws JSONException, JsonProcessingException {
+
+        HealthCheckResponse expected = new HealthCheckResponse();
+
+        for (Subsystem system : SoSubsystems.values()) {
+            expected.getSubsystems().add(new HealthCheckSubsystem(system,
+                    UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.UP));
+        }
+        expected.setMessage("HttpStatus: 200");
         Response response = globalHealthcheck("UP");
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-        HealthcheckResponse root;
-        root = (HealthcheckResponse) response.getEntity();
-        String apistatus = root.getApih();
-        assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
+        HealthCheckResponse root;
+        root = (HealthCheckResponse) response.getEntity();
+        assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
 
-        String bpmnstatus = root.getBpmn();
-        assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String sdncstatus = root.getSdncAdapter();
-        assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String asdcstatus = root.getAsdcController();
-        assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String catastatus = root.getCatalogdbAdapter();
-        assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String reqdbstatus = root.getRequestdbAdapter();
-        assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String openstatus = root.getOpenstackAdapter();
-        assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String reqdbattstatus = root.getRequestdbAdapterAttsvc();
-        assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
     }
 
     @Test
     public void globalHealthcheckAllDOWNTest() throws JSONException {
+        HealthCheckResponse expected = new HealthCheckResponse();
+
+        for (Subsystem system : SoSubsystems.values()) {
+            expected.getSubsystems().add(new HealthCheckSubsystem(system,
+                    UriBuilder.fromUri("http://localhost").build(), HealthCheckStatus.DOWN));
+        }
+        expected.setMessage("HttpStatus: 200");
         Response response = globalHealthcheck("DOWN");
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
-        HealthcheckResponse root;
-        root = (HealthcheckResponse) response.getEntity();
-        String apistatus = root.getApih();
-        assertTrue(apistatus.equalsIgnoreCase(HealthcheckStatus.UP.toString()));
-
-        String bpmnstatus = root.getBpmn();
-        assertTrue(bpmnstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String sdncstatus = root.getSdncAdapter();
-        assertTrue(sdncstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String asdcstatus = root.getAsdcController();
-        assertTrue(asdcstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String catastatus = root.getCatalogdbAdapter();
-        assertTrue(catastatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String reqdbstatus = root.getRequestdbAdapter();
-        assertTrue(reqdbstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String openstatus = root.getOpenstackAdapter();
-        assertTrue(openstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
-
-        String reqdbattstatus = root.getRequestdbAdapterAttsvc();
-        assertTrue(reqdbattstatus.equalsIgnoreCase(HealthcheckStatus.DOWN.toString()));
+        HealthCheckResponse root;
+        root = (HealthCheckResponse) response.getEntity();
+        assertThat(root, sameBeanAs(expected).ignoring("subsystems.uri").ignoring("subsystems.subsystem"));
     }
 
     @Test
@@ -189,40 +150,15 @@
         assertEquals(MediaType.APPLICATION_JSON, he.getHeaders().getContentType());
     }
 
-    @Test
-    public void getEndpointUrlForSubsystemEnumTest() {
-        ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage");
-        ReflectionTestUtils.setField(globalhealth, "endpointAsdc", "http://localhost:8080");
-        ReflectionTestUtils.setField(globalhealth, "endpointSdnc", "http://localhost:8081");
-        ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8082");
-        ReflectionTestUtils.setField(globalhealth, "endpointCatalogdb", "http://localhost:8083");
-        ReflectionTestUtils.setField(globalhealth, "endpointOpenstack", "http://localhost:8084");
-        ReflectionTestUtils.setField(globalhealth, "endpointRequestdb", "http://localhost:8085");
-        ReflectionTestUtils.setField(globalhealth, "endpointRequestdbAttsvc", "http://localhost:8086");
-
-        String result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.ASDC);
-        assertEquals("http://localhost:8080", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.SDNC);
-        assertEquals("http://localhost:8081", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.BPMN);
-        assertEquals("http://localhost:8082", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.CATALOGDB);
-        assertEquals("http://localhost:8083", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.OPENSTACK);
-        assertEquals("http://localhost:8084", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDB);
-        assertEquals("http://localhost:8085", result);
-        result = globalhealth.getEndpointUrlForSubsystemEnum(MsoSubsystems.REQUESTDBATT);
-        assertEquals("http://localhost:8086", result);
-    }
 
     @Test
     public void processResponseFromSubsystemTest() {
         SubsystemHealthcheckResponse subSystemResponse = new SubsystemHealthcheckResponse();
         subSystemResponse.setStatus("UP");
         ResponseEntity<SubsystemHealthcheckResponse> r = new ResponseEntity<>(subSystemResponse, HttpStatus.OK);
-        String result = globalhealth.processResponseFromSubsystem(r, MsoSubsystems.BPMN);
-        assertEquals("UP", result);
+        Endpoint endpoint = new Endpoint(SoSubsystems.BPMN, UriBuilder.fromUri("http://localhost").build());
+        HealthCheckStatus result = globalhealth.processResponseFromSubsystem(r, endpoint);
+        assertEquals(HealthCheckStatus.UP, result);
     }
 
 }
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
index 2e1c6a9..27e1ae9 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/application-test.yaml
@@ -9,14 +9,20 @@
 mso:
   health:
     endpoints:
-      catalogdb: http://localhost:${wiremock.server.port}
-      requestdb: http://localhost:${wiremock.server.port}
-      sdnc: http://localhost:${wiremock.server.port}
-      openstack: http://localhost:${wiremock.server.port}
-      bpmn: http://localhost:${wiremock.server.port}
-      asdc: http://localhost:${wiremock.server.port}
-      requestdbattsvc: http://localhost:${wiremock.server.port}
-      
+      - subsystem: apih
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: asdc
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: bpmn
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: catalogdb
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: openstack
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: requestdb
+        uri: http://localhost:${wiremock.server.port}
+      - subsystem: sdnc
+        uri: http://localhost:${wiremock.server.port}
   infra-requests:
     archived:
       period: 180
@@ -118,7 +124,13 @@
   port: 3307
   databaseName: catalogdb
   databaseName2: requestdb
-
+#Actuator
+management:
+  endpoints:
+    web:
+      base-path: /manage
+      exposure:
+        include: "*"
 
 org:
   onap:
