HawtioEndpoint implements WebMvcConfigurer { @RequestMapping(value = {"", "{path:^(?:(?!\\bjolokia\\b|auth|css|fonts|img|js|user|oauth|plugins|\\.).)*$}/**"}, produces = MediaType.TEXT_HTML_VALUE) public String forwardHawtioRequestToIndexHtml() { final String path = endpointPath.resolve("hawtio"); final UriComponents uriComponents = ServletUriComponentsBuilder.fromPath(path) .path("/index.html") .build(); return "forward:" + uriComponents.getPath(); } HawtioEndpoint(final EndpointPathResolver endpointPath); void setPlugins(final List<HawtioPlugin> plugins); @RequestMapping(value = {"", "{path:^(?:(?!\\bjolokia\\b|auth|css|fonts|img|js|user|oauth|plugins|\\.).)*$}/**"}, produces = MediaType.TEXT_HTML_VALUE) String forwardHawtioRequestToIndexHtml(); @RequestMapping("/plugin") @ResponseBody List<HawtioPlugin> getPlugins(); @Override void addResourceHandlers(final ResourceHandlerRegistry registry);  }
@Test public void testForwardHawtioRequestToIndexHtml() { Mockito.when(resolver.resolve("hawtio")).thenReturn("/actuator/hawtio"); String result = hawtioEndpoint.forwardHawtioRequestToIndexHtml(); assertEquals("forward:/actuator/hawtio/index.html", result); }