-
Couldn't load subscription status.
- Fork 38.8k
Description
Sam Brannen opened SPR-16574 and commented
In order to make it easier for developers to provide custom assertions when using WebTestClient, it would be beneficial to introduce dedicated consumeWith(...) methods in assertion classes such as JsonPathAssertions, HeaderAssertions, StatusAssertions, etc.
For a concrete use case, consider that you want to assert that a given evaluated JsonPath contains a specific substring. With MockMvc that's easy due to the support for Hamcrest matchers. However, with WebTestClient users have to jump through hoops to implement something as simple as containsString(...). See the linked Stack Overflow discussion for additional details.
Affects: 5.0 GA
Reference URL: https://stackoverflow.com/questions/49149376/webtestclient-check-that-jsonpath-contains-sub-string
Issue Links:
- WebTestClient does not provide Hamcrest Matcher assertions for JSONPath [SPR-16729] #21270 WebTestClient does not provide Hamcrest Matcher assertions for JSONPath