I'm trying to re-use the Springboot Actuator HealthEndpoint and InfoEndpoint beans and exposing them via rest:
However when that gets invoked, it throws a AmbiguousMethodCallException and its other candidate for "invoke()" is on the abstract class that HealthEndpoint is extending
It looks like the issue is here:
In this case HealthEndpoint extends AbstractHealthEndpoint, which is abstract, but invoke() is declared on the Endpoint interface. So this logic:
Will not evaluate to true, and the abstract method will remain a candidate.
Here are the sources for the Endpoint/HealthEndpoint/AbstractEndpoint classes:
It seems this is intentional, due to the "if the class is an interface then keep the method" comment in BeanInfo.
I'm curious as to why that is.