private void deploy(ProvisioningTester tester, ApplicationId app, ClusterSpec[] specs, Capacity[] capacities) {
        assertEquals("Equal capacity and spec count", capacities.length, specs.length);
        List<HostSpec> hostSpecs = IntStream.range(0, capacities.length)
                                            .mapToObj(i -> tester.provisioner().prepare(app, specs[i], capacities[i], log::log))
                                            .flatMap(Collection::stream)
                                            .toList();
        NestedTransaction transaction = new NestedTransaction();
        tester.provisioner().activate(hostSpecs, new ActivationContext(0, false), new ApplicationTransaction(new ApplicationMutex(app, () -> {}), transaction));
        transaction.commit();
    }
Scenario tester with real node-repository data loaded from ZK snapshot file

How to use:

1. Copy /opt/vespa/conf/configserver-app/node-flavors.xml from config server to /tmp/node-flavors.xml
2. Copy /opt/vespa/var/zookeeper/version-2/snapshot.XXX from config server to /tmp/snapshot
3. Set capacities and specs according to the wanted scenario

@author valerijf
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/RealDataScenarioTest.java