@Test
    public void dockerImageRepoIsReturnedIfSet() {
        ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.dev, RegionName.from("us-east"))).build();

        tester.makeReadyHosts(4, defaultResources);
        tester.activateTenantHosts();

        // deploy
        ApplicationId application1 = ProvisioningTester.applicationId();
        SystemState state1 = prepare(application1, tester, 1, 1, 1, 1, defaultResources, "1.2.3");
        String dockerImageRepo = "docker.domain.tld/my/image";
        prepare(application1, tester, 1, 1, 1 , 1 , false, defaultResources, "1.2.3");
        tester.activate(application1, state1.allHosts);

        HostSpec host1 = state1.container0.iterator().next();
        Node node1 = tester.nodeRepository().nodes().node(host1.hostname()).get();
        DockerImage dockerImage = DockerImage.fromString(dockerImageRepo).withTag(Version.fromString("1.2.3"));
        tester.nodeRepository().nodes().write(node1.with(node1.status().withContainerImage(dockerImage)), () -> {});

        // redeploy
        SystemState state2 = prepare(application1, tester, 1, 1, 1 ,1 , false, defaultResources, "1.2.3");
        tester.activate(application1, state2.allHosts);

        host1 = state2.container0.iterator().next();
        node1 = tester.nodeRepository().nodes().node(host1.hostname()).get();
        assertEquals(dockerImage, node1.status().containerImage().get());
    }
Various allocation sequence scenarios

@author bratseth
@author mpolden
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java