Google Groups

Re: Hamcrest matchers for JSON


SudhirR Jun 29, 2011 9:47 AM
Posted in group: Hamcrest Developers
Sure will do. Thanks for the feedback.

On Wed, Jun 29, 2011 at 9:38 PM, David Harkness <dhar...@gmail.com> wrote:

I recommend adding Json to the names, e.g. hasJsonPath. This is to distinguish them from hasXpath and friends.

On Jun 28, 2011 9:47 PM, "SudhirR" <sudhi...@gmail.com> wrote:

I am looking for the java version which does something like

assertThat(jsonObject, allOf(
  hasPath("one.two.three[3].four"),
  hasValueInPath("one.two.three[0].four.key", "value"),
  // and so on
));

This is for testing complete JSON structure in one shot. Currently we are relying on having an expected JSON and doing a toString match.

I have started with a hamcrest extension here - http://code.google.com/p/jsonmatcher




--
You received this message because you are subscribed to the Google Groups "Hamcrest Developer...

To view this discussion on the web visit https://groups.google.com/d/msg/hamcrest-dev/-/ufXi5WjJy5gJ.


To post to this group, send email to hamcre...@googlegroups.com.
To unsubscribe from this group,...

--
You received this message because you are subscribed to the Google Groups "Hamcrest Developers" group.
To post to this group, send email to hamcre...@googlegroups.com.
To unsubscribe from this group, send email to hamcrest-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hamcrest-dev?hl=en.



--
With best regards,
- Sudhir R
Tech Lead| BT, India| Blog