@Test
    void testHandlingErrorFromMessageBus() throws DocumentRetrieverException {
        ClientParameters params = createParameters()
                .setDocumentIds(asIterator(DOC_ID_1))
                .build();

        Reply r = new GetDocumentReply(null);
        r.addError(new Error(0, "Error message"));
        when(mockedSession.syncSend(any())).thenReturn(r);

        DocumentRetriever documentRetriever = createDocumentRetriever(params);
        documentRetriever.retrieveDocuments();

        assertTrue(errContent.toString().contains("Request failed"));
    }
Test class for {@link DocumentRetriever}

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