Skip to content
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

Provide XML-based assertions in WebTestClient [SPR-16741] #21282

Closed
spring-projects-issues opened this issue Apr 18, 2018 · 2 comments
Closed
Assignees
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 18, 2018

Eric Deandrea opened SPR-16741 and commented

WebTestClient is missing the ability to perform assertions against XML content like you can do with MockMvc (like with MockMvcResultMatchers.xpath). This is essential for building enterprise applications which have to support both XML & JSON.

I propose we add similar things to org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec as well as a new XpathAssertions class (similar to JsonPathAssertions) that ties into org.springframework.test.util.XpathExpectationsHelper.


Affects: 5.0.5

Issue Links:

Referenced from: commits 0c62d6b, 2734f01

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Apr 18, 2018

Eric Deandrea commented

I've created #1797

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented May 31, 2018

Eric Deandrea commented

I just wanted to see what may be going on with this one. Currently WebTestClient doesn't allow any kind of assertions against XML-based content. For enterprise applications with legacy services that are XML-based, until we have this capability we can not build reactive applications as we really have no way of testing them. We have lots of legacy services which call newer services we are building and those newer services have to be able to support both XML & JSON.

 

I added a PR to add this capability via #1797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants