Re: [rest-assured] Asserting empty json objects

1,850 views
Skip to first unread message

Johan Haleby

unread,
May 10, 2013, 2:28:10 AM5/10/13
to rest-a...@googlegroups.com
Hi, 

I think the cleanest approach would probably be to implement your own matcher. Otherwise you could use a work around similar to this:

expect().body("test.keySet()"), Matchers.emptyIterable());

Regards,
/Johan


On Wed, May 8, 2013 at 6:21 PM, <colin.d...@gmail.com> wrote:
Hi,

I have a json response that's returned from a request where part of the json can be empty e.g:

     "test": {
      }
}

I need to assert that "test" is empty. I've tried a few different matchers but nothing seems to work. Do I need to create my own matcher for this or are there any matchers about that will already cater for this?

Thanks in advance for any help.

Colin

--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages