@Test
    public void allocates_reserved_nodes_for_type_spec_deployment() {
        ProvisioningTester tester = new ProvisioningTester.Builder().build();
        Function<InfraApplication, Collection<HostSpec>> prepareAndActivate = app -> tester.activate(app.getApplicationId(),
                tester.prepare(app.getApplicationId(), app.getClusterSpecWithVersion(Version.fromString("1.2.3")), app.getCapacity()));

        // Add 2 config server hosts and 2 config servers
        Flavor flavor = tester.nodeRepository().flavors().getFlavorOrThrow("default");
        List<Node> nodes = List.of(
                Node.create("cfghost1", IP.Config.of(List.of("::1:0"), List.of("::1:1")), "cfghost1", flavor, NodeType.confighost).build(),
                Node.create("cfghost2", IP.Config.of(List.of("::2:0"), List.of("::2:1")), "cfghost2", flavor, NodeType.confighost).ipConfig(IP.Config.of(List.of("::2:0"), List.of("::2:1"), List.of())).build(),
                Node.create("cfg1", IP.Config.of(List.of("::1:1"), List.of()), "cfg1", flavor, NodeType.config).parentHostname("cfghost1").build(),
                Node.create("cfg2", IP.Config.of(List.of("::2:1"), List.of()), "cfg2", flavor, NodeType.config).parentHostname("cfghost2").build());
        tester.move(Node.State.ready, tester.nodeRepository().nodes().addNodes(nodes, Agent.system));

        InfraApplication cfgHostApp = new ConfigServerHostApplication();
        InfraApplication cfgApp = new ConfigServerApplication();

        // Attempt to prepare & activate cfg, this should fail as cfg hosts are not active
        try {
            prepareAndActivate.apply(cfgApp);
        } catch (ParentHostUnavailableException ignored) { }
        assertEquals(2, tester.nodeRepository().nodes().list().owner(cfgApp.getApplicationId()).state(Node.State.reserved).size());

        prepareAndActivate.apply(cfgHostApp);

        // After activating cfg hosts, we can activate cfgs and all 4 should become active
        prepareAndActivate.apply(cfgApp);
        assertEquals(4, tester.nodeRepository().nodes().list().state(Node.State.active).size());
    }
Test always uses the zone default resources
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java