-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lacking org.hamcrest.Matcher helpers to perform assertion in unit tests #162
Comments
I think there could be a |
Hello, @DevDengChao According to the context, I think methods and ability should be add in the JsonProvider interface If SpringMvc still uses JsonPath? Or say you want SringMvc directly uses JsonSmart, and we add these abilities to JsonSmart? |
👍 Then here comes a question, should JsonPath be responsible to implement matchers for all json providers itself or it is only responsible to delegate requests, eg: from |
For me, I think JsonSmart should implement its matchers itself. |
I've found a existing json matchers facade https://github.com/Crunc/hamcrest-json-matchers , but it does not support JsonSmart now, nor support making assertion on json array element. 😢 |
Story
Spring MVC's
MockMvcResultMatchers#jsonPath()
usescom.jayway.jsonpath.JsonPath
to evaluate string content into objects, and JsonPath usesJsonSmartJsonProvider
by default, when a developer attempt to do an unit test like below, there is no suitable helper methods he/she can use:Expected solution
Provide some org.hamcrest.Matcher helpers like
Matchers.arrayContaining()
?Related documents
The text was updated successfully, but these errors were encountered: