### Question:
ElasticSearchProvider implements ExternalSearchProvider<ElasticSearchProviderTraits> { @Override public String getDocumentText(DocumentRepository aRepository, ElasticSearchProviderTraits aTraits, String aCollectionId, String aDocumentId) throws IOException { if (!aCollectionId.equals(aTraits.getIndexName())) { throw new IllegalArgumentException( "Requested collection name does not match connection collection name"); } GetRequest getRequest = new GetRequest(aTraits.getIndexName(), aTraits.getObjectType(), aDocumentId); try (RestHighLevelClient client = makeClient(aTraits)) { Map<String, Object> result = client.get(getRequest).getSourceAsMap(); Map<String, String> document = (Map) result.get(ELASTIC_HIT_DOC_KEY); return (document.get(DOC_TEXT_KEY)); } }  @Override List<ExternalSearchResult> executeQuery(DocumentRepository aRepository,
            ElasticSearchProviderTraits aTraits, String aQuery); @Override ExternalSearchResult getDocumentResult(DocumentRepository aRepository,
            ElasticSearchProviderTraits aTraits, String aCollectionId, String aDocumentId); @Override String getDocumentText(DocumentRepository aRepository,
            ElasticSearchProviderTraits aTraits, String aCollectionId, String aDocumentId); @Override InputStream getDocumentAsStream(DocumentRepository aRepository,
            ElasticSearchProviderTraits aTraits, String aCollectionId, String aDocumentId); @Override String getDocumentFormat(DocumentRepository aRepository,
            ElasticSearchProviderTraits aTraits, String aCollectionId, String aDocumentId);  }### Answer:
@Test public void thatDocumentTextCanBeRetrieved() throws Exception { String documentText = sut.getDocumentText(repo, traits, "common-crawl-en", "TcBhiGABg9im2MD5uAjq"); assertThat(documentText).isNotNull(); }