@Test
    public void testCreateNeededModelVersionsForManuallyDeployedApps() {
        List<Host> hosts = createHosts(7, "7.0.0");

        CountingModelFactory factory700 = createHostedModelFactory(Version.fromString("7.0.0"), devZone);
        CountingModelFactory factory710 = createHostedModelFactory(Version.fromString("7.1.0"), devZone);
        CountingModelFactory factory720 = createHostedModelFactory(Version.fromString("7.2.0"), devZone);
        List<ModelFactory> modelFactories = List.of(factory700, factory710, factory720);

        DeployTester tester = createTester(hosts, modelFactories, devZone);
        // Deploy with version that does not exist on hosts, the model for this version should also be created
        tester.deployApp("src/test/apps/hosted/", "7.2.0");
        assertEquals(7, tester.getAllocatedHostsOf(tester.applicationId()).getHosts().size());

        // Check >0 not ==0 as the session watcher thread is running and will redeploy models in the background
        // Nodes are on 7.0.0 (should be created), no nodes on 7.1.0 (should not be created), 7.2.0 should always be created
        assertTrue(factory700.creationCount() > 0);
        assertFalse(factory710.creationCount() > 0);
        assertTrue("Newest model for latest major version is always included", factory720.creationCount() > 0);
    }
Test that deploying an application in a manually deployed zone creates all needed model versions
(not just the latest one, manually deployed apps always have skipOldConfigModels set to true)
configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java