@Test
    public void node_on_spare_host_retired_first() {
        ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east")))
                .spareCount(1).build();
        tester.makeReadyHosts(7, defaultResources).activateTenantHosts();

        ApplicationId application = ProvisioningTester.applicationId();
        ClusterSpec spec = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("content1")).vespaVersion("7.1.2").build();

        tester.deploy(application, spec, Capacity.from(new ClusterResources(6, 1, defaultResources)));

        // Pick out a random application node and make its parent larger, this will make it the spare host
        NodeList nodes = tester.nodeRepository().nodes().list();
        Node randomNode = nodes.owner(application).shuffle(new Random()).first().get();
        tester.nodeRepository().nodes().write(nodes.parentOf(randomNode).get()
                .with(new Flavor(new NodeResources(2, 10, 20, 8)), Agent.system, tester.nodeRepository().clock().instant()), () -> {});

        // Re-deploy application with 1 node less, the retired node should be on the spare host
        tester.deploy(application, spec, Capacity.from(new ClusterResources(5, 1, defaultResources)));

        assertTrue(tester.nodeRepository().nodes().node(randomNode.hostname()).get().allocation().get().membership().retired());
    }
Test always uses the zone default resources
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java