MetadataGeneratorFilter extends GenericFilterBean { protected String getDefaultBaseURL(HttpServletRequest request) { StringBuilder sb = new StringBuilder(); sb.append(request.getScheme()).append(": sb.append(request.getContextPath()); String url = sb.toString(); if (isNormalizeBaseUrl()) { return SimpleURLCanonicalizer.canonicalize(url); } else { return url; } } MetadataGeneratorFilter(MetadataGenerator generator); void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); @Autowired(required = false) void setDisplayFilter(MetadataDisplayFilter displayFilter); @Autowired void setManager(MetadataManager manager); boolean isNormalizeBaseUrl(); void setNormalizeBaseUrl(boolean normalizeBaseUrl); @Override void afterPropertiesSet();  }
@Test public void testDefaultBaseUrlDefault() { httpRequest.setServerName("testServer"); httpRequest.setScheme("HTTP"); httpRequest.setContextPath("/myContext"); httpRequest.setServerPort(80); String baseURL = filter.getDefaultBaseURL(httpRequest); assertEquals("HTTP: }