@Test
    void testInvalidClusterName() throws DocumentRetrieverException {
        Throwable exception = assertThrows(DocumentRetrieverException.class, () -> {

            ClientParameters params = createParameters()
                    .setCluster("invalidclustername")
                    .build();

            ClusterList clusterList = new ClusterList(List.of(new ClusterDef("storage")));

            DocumentRetriever documentRetriever = createDocumentRetriever(params, clusterList);
            documentRetriever.retrieveDocuments();
        });
        assertTrue(exception.getMessage().contains("The Vespa cluster contains the content clusters storage, not invalidclustername. Please select a valid vespa cluster."));
    }
Test class for {@link DocumentRetriever}

@author bjorncs
vespaclient-java/src/test/java/com/yahoo/vespaget/DocumentRetrieverTest.java