TLDR: Need to create java SearchResponse out of json string
I'm writing some unit tests in Java and I have a specific json string from a search response (one created in kibana) that I would like to use.
I need to create a SearchResponse (the java object) out of this json so that I can pass it to the same methods that the actual response from the client goes to.
I've tried using a jackson ObjectMapper and calling readValue or convertValue with no luck. From looking at some of the docs I think I need to use an XContentBuilder but I'm struggling to get it to work.
Any help is appreciated.