# Json to SearchResponse? or How to Mock a SearchResponse?

**URL:** <https://discuss.elastic.co/t/json-to-searchresponse-or-how-to-mock-a-searchresponse/72077>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 7:50pm UTC](https://discuss.elastic.co/t/json-to-searchresponse-or-how-to-mock-a-searchresponse/72077 "2017-01-18T19:50:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanAaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathanaaron/32/24405_2.png) [@JonathanAaron](https://discuss.elastic.co/u/JonathanAaron)\
**Post date:** [January 18, 2017, 7:50pm UTC](https://discuss.elastic.co/t/json-to-searchresponse-or-how-to-mock-a-searchresponse/72077/1 "2017-01-18T19:50:43Z")

</div>

Is there anyway to convert the response value I got from my transport client(json) into a SearchResponse object?

I'm doing some unit testing and would like to mock out the SearchResponse Object. For these tests I don't want to spin up a node or embedded elasticsearch.

Thanks,

Jonathan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2017, 7:50pm UTC](https://discuss.elastic.co/t/json-to-searchresponse-or-how-to-mock-a-searchresponse/72077/2 "2017-02-15T19:50:49Z")

</div>

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