Mockito Test for Elastic Java api client

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 = -> s
    .query(q -> q
        .term(t -> t
            .value(v -> v.stringValue("bicycle"))

for (Hit<Product> hit: search.hits().hits()) {

Any idea how to do that?

CC - @swallez

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.