/**
   * Constructs a new instance of the DefaultRuntimeInjector, for test use.
   *
   * @param config The instance of the FilterConfig.
   * @param filterConfiguration An instance of the FilterConfiguration.
   * @throws ServletException If there is an error reading the Filter Config.
   * @throws AuthException If there is an error getting the ServerAuthContext instance.
   */
  DefaultRuntimeInjector(final FilterConfig config, final FilterConfiguration filterConfiguration)
      throws ServletException, AuthException {

    this.filterConfiguration = filterConfiguration;

    /*
     * Must set the loggers before initialising anything else otherwise classes with static loggers will get the
     * NOP implementations
     */
    LoggingConfigurator<MessageInfo> loggingConfigurator = getLoggingConfigurator(config);
    LogFactory.setAuditLogger(loggingConfigurator.getAuditLogger());
    LogFactory.setDebugLogger(loggingConfigurator.getDebugLogger());
    LOGGER.setDebugLogger(LogFactory.getDebug());

    ServerContextFactory serverContextFactory = getServerContextFactory(config);

    MessageInfoUtils messageInfoUtils = new MessageInfoUtils();
    HttpServletCallbackHandler callbackHandler = new HttpServletCallbackHandler();
    ContextHandler contextHandler = new ContextHandler(messageInfoUtils);
    ServerAuthContext serverAuthContext =
        serverContextFactory.getServerAuthContext(
            messageInfoUtils, callbackHandler, contextHandler);

    RuntimeResultHandler runtimeResultHandler = new RuntimeResultHandler();

    this.jaspiRuntime = new JaspiRuntime(serverAuthContext, runtimeResultHandler);
    LOGGER.debug("Finished initialising the DefaultRuntimeInjector");
  }