6565 */
6666public class MicroProfileApplication extends GenericContainer <MicroProfileApplication > {
6767
68- private static final String MP_HEALTH_READINESS_PATH = "/health/ready" ;
68+ /**
69+ * A path representing the MicroProfile Health 2.0 readiness check
70+ */
71+ public static final String MP_HEALTH_READINESS_PATH = "/health/ready" ;
72+
6973 private static final Logger LOGGER = LoggerFactory .getLogger (MicroProfileApplication .class );
70- private static final boolean mpHealth20Available ;
7174 private static final boolean isHollow = isHollow ();
72- static {
73- Class <?> readinessClass = null ;
74- try {
75- readinessClass = Class .forName ("org.eclipse.microprofile.health.Readiness" );
76- } catch (ClassNotFoundException e ) {
77- }
78- mpHealth20Available = readinessClass != null ;
79- }
8075
8176 private String appContextRoot ;
8277 private ServerAdapter serverAdapter ;
@@ -232,13 +227,12 @@ protected void configure() {
232227 super .configure ();
233228 // If the readiness path was not set explicitly, default it to:
234229 // A) The value defined by ServerAdapter.getReadinessPath(), if any
235- // B) The standard MP Health 2.0 readiness endpoint (if available)
236- // C) the app context root
230+ // B) the app context root
237231 if (!readinessPathSet ) {
238- if (serverAdapter != null && serverAdapter .getReadinessPath ().isPresent () && ! serverAdapter . getReadinessPath (). get (). trim (). isEmpty () ) {
232+ if (serverAdapter != null && serverAdapter .getReadinessPath ().isPresent ()) {
239233 withReadinessPath (serverAdapter .getReadinessPath ().get ());
240234 } else {
241- withReadinessPath (mpHealth20Available ? MP_HEALTH_READINESS_PATH : appContextRoot );
235+ withReadinessPath (appContextRoot );
242236 }
243237 }
244238 }
@@ -322,11 +316,7 @@ public MicroProfileApplication withAppContextRoot(String appContextRoot) {
322316 /**
323317 * Sets the path to be used to determine container readiness. The readiness check will
324318 * timeout after a sensible amount of time has elapsed.
325- * If unspecified, the readiness path with defailt to either:
326- * <ol><li>The MicroProfile Health 2.0 readiness endpoint <code>/health/readiness</code>,
327- * if MP Health 2.0 API is accessible</li>
328- * <li>Otherwise, the application context root</li>
329- * </ol>
319+ * If unspecified, the readiness path with defailt to the application context root
330320 *
331321 * @param readinessUrl The HTTP endpoint to be polled for readiness. Once the endpoint
332322 * returns HTTP 200 (OK), the container is considered to be ready.
@@ -340,11 +330,7 @@ public MicroProfileApplication withReadinessPath(String readinessUrl) {
340330 /**
341331 * Sets the path to be used to determine container readiness. The readiness check will
342332 * timeout after a sensible amount of time has elapsed.
343- * If unspecified, the readiness path with defailt to either:
344- * <ol><li>The MicroProfile Health 2.0 readiness endpoint <code>/health/readiness</code>,
345- * if MP Health 2.0 API is accessible</li>
346- * <li>Otherwise, the application context root</li>
347- * </ol>
333+ * If unspecified, the readiness path with defailt to the application context root
348334 *
349335 * @param readinessUrl The HTTP endpoint to be polled for readiness. Once the endpoint
350336 * returns HTTP 200 (OK), the container is considered to be ready.
0 commit comments