PentahoWebContextFilter implements Filter { HashMap<String, String> getWebContextVariables( HttpServletRequest request ) throws IOException { HashMap<String, String> map = new HashMap<>(); map.put( "requireCfg", getRequireCfgVar() ); map.put( "ssoEnabled", getSsoEnabled() ); map.put( "application", getApplicationVar( request ) ); map.put( "PENTAHO_CONTEXT_NAME", getContextNameVar( request ) ); map.put( "FULL_QUALIFIED_URL", getFullyQualifiedServerUrlVar() ); map.put( "CONTEXT_PATH", getContextPathVar( request ) ); map.put( "SERVER_PROTOCOL", getServerProtocolVar() ); map.put( "active_theme", getActiveThemeVar( request ) ); map.put( "SESSION_LOCALE", getLocaleVar( request ) ); map.put( "SESSION_NAME", getSessionNameVar() ); map.put( "HOME_FOLDER", getHomeFolderVar() ); map.put( "DEFAULT_FOLDER", getDefaultFolderVar() ); map.put( "RESERVED_CHARS", getReservedCharsVar() ); map.put( "RESERVED_CHARS_DISPLAY", getReservedCharsDisplayVar() ); map.put( "RESERVED_CHARS_REGEX_PATTERN", getReservedRegexPatternVar() ); map.put( PLATFORM_OSGI_BRIDGE_ID, getOsgiBridgePath( request ) ); map.put( SERVICES_CONTEXT_PROPERTY, getServicesPath() ); return map; }  @Override void init( FilterConfig filterConfig ); @Override void destroy(); @Override void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ); String getSsoEnabled(); void setSsoEnabled( String ssoEnabled ); static final String WEB_CONTEXT_JS; static final String PARAM_SSO_ENABLED; }
@Test public void testDoGetWithFullyQualifiedUrlTrue() throws ServletException, IOException { when( this.mockRequest.getParameter( PentahoWebContextFilter.USE_FULL_URL_PARAM ) ).thenReturn( "true" ); final String response = executeWebContextFilter(); String fullyQualifiedServerURL = this.pentahoWebContextFilter .getWebContextVariables( this.mockRequest ).get( "FULL_QUALIFIED_URL" ); assertTrue( this.responseSetsContextPathGlobal( response, fullyQualifiedServerURL ) ); assertTrue( this.requirejsManagerInitIsCalled( response, "true" ) ); }