GERONIMO-6758 ensure multiple health checks work (mp-health 2.1)
diff --git a/geronimo-health/pom.xml b/geronimo-health/pom.xml
index 24d6826..3011587 100644
--- a/geronimo-health/pom.xml
+++ b/geronimo-health/pom.xml
@@ -21,11 +21,11 @@
   <parent>
     <artifactId>geronimo-health-parent</artifactId>
     <groupId>org.apache.geronimo</groupId>
-    <version>1.0.3-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>geronimo-health</artifactId>
-  <version>1.0.3-SNAPSHOT</version>
+  <version>2.0.0-SNAPSHOT</version>
   <name>Geronimo Health :: Microprofile</name>
 
   <properties>
diff --git a/geronimo-health/src/main/java/org/apache/geronimo/microprofile/impl/health/cdi/GeronimoHealthExtension.java b/geronimo-health/src/main/java/org/apache/geronimo/microprofile/impl/health/cdi/GeronimoHealthExtension.java
index 10998a8..c9f72ae 100644
--- a/geronimo-health/src/main/java/org/apache/geronimo/microprofile/impl/health/cdi/GeronimoHealthExtension.java
+++ b/geronimo-health/src/main/java/org/apache/geronimo/microprofile/impl/health/cdi/GeronimoHealthExtension.java
@@ -132,12 +132,16 @@
 
     private HealthCheck lookup(final Bean<?> bean, final BeanManager manager) {
         // if this is not an instance of HealthCheck, then it's a producer (not sure it's enough)
-        final Class<?> type = bean.getBeanClass() == null || !HealthCheck.class.isAssignableFrom(bean.getBeanClass())
-                ? HealthCheck.class
-                : bean.getBeanClass();
-        final Set<Annotation> qualifiers = bean.getQualifiers();
-        final Set<Bean<?>> beans = manager.getBeans(type, qualifiers.toArray(new Annotation[qualifiers.size()]));
-        final Bean<?> resolvedBean = manager.resolve(beans);
+        final Class<?> type = bean.getBeanClass() == null ?
+                HealthCheck.class :
+                (bean.getTypes().contains(bean.getBeanClass()) ? bean.getBeanClass() : HealthCheck.class);
+        final Bean<?> resolvedBean;
+        if (type != HealthCheck.class) {
+            final Set<Bean<?>> beans = manager.getBeans(type, bean.getQualifiers().toArray(new Annotation[0]));
+            resolvedBean = manager.resolve(beans);
+        } else {
+            resolvedBean = bean;
+        }
         final CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
         if (!manager.isNormalScope(resolvedBean.getScope())) {
             contexts.add(creationalContext);