public PrepareAndActivateResult deploy(CompressedApplicationInputStream in, PrepareParams prepareParams) {
        DeployHandlerLogger logger = DeployHandlerLogger.forPrepareParams(prepareParams);
        File tempDir = uncheck(() -> Files.createTempDirectory("deploy")).toFile();
        ThreadLockStats threadLockStats = LockStats.getForCurrentThread();
        PrepareAndActivateResult result;
        try {
            threadLockStats.startRecording("deploy of " + prepareParams.getApplicationId().serializedForm());
            result = deploy(decompressApplication(in, tempDir), prepareParams, logger);
        } finally {
            threadLockStats.stopRecording();
            cleanupTempDirectory(tempDir, logger);
        }
        return result;
    }
@Test
    public void testResolveConfigForMultipleApps() {
        Version vespaVersion = VespaModelFactory.createTestFactory().version();
        applicationRepository.deploy(app1, new PrepareParams.Builder()
                .applicationId(applicationId())
                .vespaVersion(vespaVersion)
                .build());

        ApplicationId appId2 = new ApplicationId.Builder()
                .tenant(tenant1)
                .applicationName("myapp2")
                .instanceName("default")
                .build();
        applicationRepository.deploy(app2, new PrepareParams.Builder()
                .applicationId(appId2)
                .vespaVersion(vespaVersion)
                .build());

        SimpletypesConfig config = resolve(applicationId(), vespaVersion);
        assertEquals(1337, config.intval());

        SimpletypesConfig config2 = resolve(appId2, vespaVersion);
        assertEquals(1330, config2.intval());

        RequestHandler requestHandler = getRequestHandler(applicationId());
        assertTrue(requestHandler.hasApplication(applicationId(), Optional.of(vespaVersion)));
        assertNull(requestHandler.resolveApplicationId("doesnotexist"));
        assertEquals(new ApplicationId.Builder().tenant(tenant1).applicationName("testapp").build(),
                     requestHandler.resolveApplicationId("mytesthost")); // Host set in application package.
    }