@Test
    public void only_remove_tenant_docker_containers_for_new_allocations() {
        NodeRepositoryTester tester = new NodeRepositoryTester();
        tester.addHost("host1", "host1", "default", NodeType.host);
        tester.addHost("tenant1", "tenant1", "docker", NodeType.tenant);
        tester.addHost("cfg1", "cfg1", "docker", NodeType.config);

        tester.nodeRepository().nodes().markNodeAvailableForNewAllocation("host1", Agent.system, getClass().getSimpleName());
        assertEquals(Node.State.ready, tester.nodeRepository().nodes().node("host1").get().state());

        tester.nodeRepository().nodes().deallocateRecursively("tenant1", Agent.system, getClass().getSimpleName());
        tester.nodeRepository().nodes().markNodeAvailableForNewAllocation("tenant1", Agent.system, getClass().getSimpleName());
        assertFalse(tester.nodeRepository().nodes().node("tenant1").isPresent());

        tester.nodeRepository().nodes().markNodeAvailableForNewAllocation("cfg1", Agent.system, getClass().getSimpleName());
        assertEquals(Node.State.ready, tester.nodeRepository().nodes().node("cfg1").get().state());
    }
tests basic operation of the node repository

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