use of org.elasticsearch.script.mustache.MultiSearchTemplateResponse in project apm-agent-java by elastic.
the class AbstractEs6_4ClientInstrumentationTest method testMultisearchTemplateRequest_validateSpanContentAndDbContext.
@Test
public void testMultisearchTemplateRequest_validateSpanContentAndDbContext() throws InterruptedException, ExecutionException, IOException {
createDocument();
reporter.reset();
SearchTemplateRequest searchTemplateRequest = prepareSearchTemplateRequest();
MultiSearchTemplateRequest multiRequest = new MultiSearchTemplateRequest();
multiRequest.add(searchTemplateRequest);
MultiSearchTemplateResponse response = doMultiSearchTemplate(multiRequest);
MultiSearchTemplateResponse.Item[] items = response.getResponses();
assertThat(items.length).isEqualTo(1);
verifyTotalHits(items[0].getResponse().getResponse().getHits());
List<Span> spans = reporter.getSpans();
assertThat(spans).hasSize(1);
Span span = spans.get(0);
validateSpanContent(span, String.format("Elasticsearch: POST /_msearch/template", INDEX), 200, "POST");
verifyMultiSearchTemplateSpanContent(span);
deleteDocument();
}
Aggregations