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

XML comments will counted as "normal" child element #86

Closed
toschneck opened this Issue Mar 16, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@toschneck
Collaborator

toschneck commented Mar 16, 2016

If client sends to citrus-server an XML which contains a comment inside of a XML element, citrus will count the comment element as normal XML child element. This will break the test, only if some add an additional comment to the client request.

Citrus version: 2.5

client message:

<?xml version="1.0" encoding="UTF-8"?>
<request>
    <!-- some example comment -->
    <fields>test</fields>
</request>

validation code:

http().server(httpserver)
                      .post("/request-endpoint/xml")
                      .payload(getResource("/request.xml"))
                      .timeout(10000)
<?xml version="1.0" encoding="UTF-8"?>
<not-valid-request>
    <fields>test</fields>
</not-valid-request>

validation error message:
Number of child elements not equal for element 'request', expected '1' but was '2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment