PluginDispatchServlet implements Servlet { @VisibleForTesting protected String getServerUrl( String contextPath ) { String fullyQualifiedServerURL = PentahoSystem.getApplicationContext().getFullyQualifiedServerURL(); fullyQualifiedServerURL = fullyQualifiedServerURL.replaceFirst( "/?" + contextPath + "/?", "" ); return fullyQualifiedServerURL; } PluginDispatchServlet(); void destroy(); void service( final ServletRequest req, final ServletResponse res ); String getDispatchKey( HttpServletRequest request ); void init( final ServletConfig config ); ServletConfig getServletConfig(); String getServletInfo();  }
@Test public void testGetServerUrl() { String serverUrl = pluginDispatchServlet.getServerUrl( "/pentaho" ); assertEquals( "http: }