(Using v6.5.2 of both cluster and Java clients)
I am attempting to implement an application that uses the Elasticsearch aggregations API to provide a variety of metrics to a client. I want to be able to unit test the lower-level code in my application that converts Elasticsearch SearchResponse and Aggregations objects into my applications' internal models. However, creating these models is prohibitively difficult and mocking them is cumbersome, if not impossible.
- Is there a simple means to create a model like Aggregations (using fromXContent, perhaps?) that I am missing?
- Is there a strategy for mocking the RestHighLevelClient such that I can then validate our application's business logic performed on the Elasticsearch models?
Thanks for any help