diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java index d80f10b..0631693 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java @@ -11,6 +11,8 @@ import javax.ws.rs.core.Response; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.HealthCheckResponse.Status; +import org.eclipse.microprofile.health.Liveness; /** * The Class UriResolverHealthCheck. @@ -28,7 +30,6 @@ public class UriResolverHealthCheck implements HealthCheck { public Response check() { HealthCheckResponse hcr = call(); - return Response.ok().entity(hcr).build(); } @@ -37,26 +38,10 @@ public class UriResolverHealthCheck implements HealthCheck { * * @return the health check response */ + @Liveness @Override public HealthCheckResponse call() { - // return HealthCheckResponse.named("uri-resolver").up().build(); - // WORKS in native - return new HealthCheckResponse() { - @Override - public String getName() { - return "uri-resolver"; - } - - @Override - public Status getStatus() { - return Status.UP; - } - - @Override - public Optional> getData() { - return Optional.empty(); - } - }; + return new HealthCheckResponse("uri-resolver", Status.UP, Optional.empty()); } } \ No newline at end of file