I have tried to mock the response for the below method, but it's not working. Not able to mock the search.hits().hits() method.
SearchResponse<Product> search = client.search(s -> s
.index("products")
.query(q -> q
.term(t -> t
.field("name")
.value(v -> v.stringValue("bicycle"))
)),
Product.class);
for (Hit<Product> hit: search.hits().hits()) {
processProduct(hit.source());
}
Any idea how to do that?
CC - @swallez