Search in sources :

Example 1 with MvcEndpoints

use of org.springframework.boot.actuate.endpoint.mvc.MvcEndpoints in project spring-boot by spring-projects.

the class LinksEnhancerTests method getLinksEnhancer.

private LinksEnhancer getLinksEnhancer(List<MvcEndpoint> endpoints) throws Exception {
    StaticWebApplicationContext context = new StaticWebApplicationContext();
    for (MvcEndpoint endpoint : endpoints) {
        context.getDefaultListableBeanFactory().registerSingleton(endpoint.toString(), endpoint);
    }
    MvcEndpoints mvcEndpoints = new MvcEndpoints();
    mvcEndpoints.setApplicationContext(context);
    mvcEndpoints.afterPropertiesSet();
    return new LinksEnhancer("", mvcEndpoints);
}
Also used : AbstractMvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.AbstractMvcEndpoint) MvcEndpoint(org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint) StaticWebApplicationContext(org.springframework.web.context.support.StaticWebApplicationContext) MvcEndpoints(org.springframework.boot.actuate.endpoint.mvc.MvcEndpoints)

Aggregations

AbstractMvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.AbstractMvcEndpoint)1 MvcEndpoint (org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint)1 MvcEndpoints (org.springframework.boot.actuate.endpoint.mvc.MvcEndpoints)1 StaticWebApplicationContext (org.springframework.web.context.support.StaticWebApplicationContext)1