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

        ApplicationId application = ProvisioningTester.applicationId();
        Capacity capacityCanFail = Capacity.from(new ClusterResources(5, 1, defaultResources), false, true);
        ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("music")).vespaVersion("4.5.6").build();

        tester.activate(application, tester.prepare(application, cluster, capacityCanFail));
        assertEquals(0, tester.nodeRepository().nodes().list(Node.State.active).owner(application).retired().size());

        tester.patchNode(tester.nodeRepository().nodes().list().owner(application).first().orElseThrow(), n -> n.withWantToRetire(true, Agent.system, tester.clock().instant()));
        tester.activate(application, tester.prepare(application, cluster, capacityCanFail));
        assertEquals(1, tester.nodeRepository().nodes().list(Node.State.active).owner(application).retired().size());
        assertEquals(6, tester.nodeRepository().nodes().list(Node.State.active).owner(application).size());

        Capacity capacityCannotFail = Capacity.from(new ClusterResources(5, 1, defaultResources), false, false);
        tester.activate(application, tester.prepare(application, cluster, capacityCannotFail));
        assertEquals(0, tester.nodeRepository().nodes().list(Node.State.reserved).owner(application).size());
        assertEquals(1, tester.nodeRepository().nodes().list(Node.State.active).owner(application).retired().size());
        assertEquals(6, tester.nodeRepository().nodes().list(Node.State.active).owner(application).size());
    }
Test always uses the zone default resources
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java