jungm opened a new pull request, #2960: URL: https://github.com/apache/tomee/pull/2960
Fixes [TOMEE-4716](https://issues.apache.org/jira/browse/TOMEE-4716): with the MicroProfile distribution, a webapp that declares a JAX-RS `Application` listing its classes has no `/health`, `/health/live`, `/health/ready` or `/health/started` (all 404); an `Application` listing nothing gets them under its own path, e.g. `/api/health`. `MicroProfileHealthChecksEndpoint` only reached a webapp through class scanning (`WebAppInfo.restClass`), and `RESTService` only deploys scanned classes into the default application (no `Application` declared) or into an `Application` that lists nothing. Since TOMEE-3729 a declared `Application` deploys exactly the classes it lists, so the endpoint went with the rest of the scanned classes. [MicroProfile Health 4.0.1](https://download.eclipse.org/microprofile/microprofile-health-4.0.1/microprofile-health-spec-4.0.1.html#_rationale) describes the endpoints as representing the entire runtime, not one JAX-RS application. `TomEEMicroProfileListener` now registers the endpoint in a new `WebAppInfo.containerRestClass` set, and `RESTService` deploys those classes at the context root: as their own internal application when the webapp declares `Application` subclasses, as part of the default application otherwise, and in the per-class fallback deployment. TOMEE-3729's rule is unchanged, and the existing removal of the endpoint when a servlet is mapped to `/*` still applies. New `HealthEndpointTest` in `tomee-microprofile-itests` deploys an `@ApplicationPath("/api")` application once listing its resource and once listing nothing. Both fail with 404 on `/test/health` without the fix and pass with it. The rest of `tomee-microprofile-itests`, `openejb-cxf-rs` (115 tests) and the MicroProfile Health TCK (28 tests) pass. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
