@Inject
    public RpcServer(ConfigserverConfig config, SuperModelRequestHandler superModelRequestHandler,
                     MetricUpdaterFactory metrics, HostRegistry hostRegistry,
                     FileServer fileServer, RpcAuthorizer rpcAuthorizer,
                     RpcRequestHandlerProvider handlerProvider) {
        this.superModelRequestHandler = superModelRequestHandler;
        metricUpdaterFactory = metrics;
        supervisor.setMaxOutputBufferSize(config.maxoutputbuffersize());
        this.metrics = metrics.getOrCreateMetricUpdater(Map.of());
        BlockingQueue<Runnable> workQueue = new LinkedBlockingQueue<>(config.maxgetconfigclients());
        int rpcWorkerThreads = (config.numRpcThreads() == 0) ? threadsToUse() : config.numRpcThreads();
        executorService = new ThreadPoolExecutor(rpcWorkerThreads, rpcWorkerThreads,
                0, TimeUnit.SECONDS, workQueue, ThreadFactoryFactory.getDaemonThreadFactory(THREADPOOL_NAME));
        delayedConfigResponses = new DelayedConfigResponses(this, config.numDelayedResponseThreads());
        spec = new Spec(null, config.rpcport());
        this.hostRegistry = hostRegistry;
        this.useRequestVersion = config.useVespaVersionInRequest();
        this.hostedVespa = config.hostedVespa();
        this.canReturnEmptySentinelConfig = config.canReturnEmptySentinelConfig();
        this.fileServer = fileServer;
        this.rpcAuthorizer = rpcAuthorizer;
        downloader = fileServer.downloader();
        handlerProvider.setInstance(this);
        setUpFileDistributionHandlers();
    }
@Test
    public void testRpcServer() throws IOException, SAXException, InterruptedException {
        try (RpcTester tester = new RpcTester(applicationId, temporaryFolder)) {
            ApplicationRepository applicationRepository = tester.applicationRepository();
            applicationRepository.deploy(testApp, new PrepareParams.Builder().applicationId(applicationId).build());
            testPrintStatistics(tester);
            testGetConfig(tester);
            testEnabled(tester);
            testApplicationNotLoadedErrorWhenAppDeleted(tester);
        }
    }