@Test
    public void testAccessControlIsOnlyCheckedWhenNoProdDeploymentExists() {
        // Provisioner does not reuse hosts, so need twice as many hosts as app requires
        List<Host> hosts = createHosts(18, "6.0.0");

        List<ModelFactory> modelFactories = List.of(createHostedModelFactory(Version.fromString("6.0.0")),
                                                    createHostedModelFactory(Version.fromString("6.1.0")),
                                                    createHostedModelFactory(Version.fromString("6.2.0")));

        DeployTester tester = createTester(hosts, modelFactories, prodZone, Clock.systemUTC());
        ApplicationId applicationId = tester.applicationId();
        // Deploy with oldest version
        tester.deployApp("src/test/apps/hosted/", "6.0.0");
        assertEquals(9, tester.getAllocatedHostsOf(applicationId).getHosts().size());

        // Deploy with version that does not exist on hosts and with app package that has no write access control,
        // validation of access control should not be done, since the app is already deployed in prod
        tester.deployApp("src/test/apps/hosted-no-write-access-control", "6.1.0");
        assertEquals(9, tester.getAllocatedHostsOf(applicationId).getHosts().size());
    }
Test that deploying an application works when there are no allocated hosts in the system
(the bootstrap a new zone case, so deploying the routing app since that is the first deployment
that will be done)
configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java