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

XmlBodyMatcher - Interactions that contains rules with invalid syntax are not marked as failed #957

Closed
vasile21 opened this issue Oct 16, 2019 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@vasile21
Copy link

vasile21 commented Oct 16, 2019

I am using pact-jvm-provider-junit_2.12,version 3.6.10 and I have a problem with verifying if defined rules by provider are valid.
Our application is having an XML request body and response and I am trying to verify if a specific field is having a value for an attribute.
The following rule:

"$.serviceNode.entity.status.thirdNode['@description]": {
          "match": "regex",
          "regex": "^.*Not eligible.*$"
        },

has a synstax error due to the fact that description attribute is not enclosed with '', valid syntax would be ['@description']
In console there is a WARN about this:
[main] WARN au.com.dius.pact.matchers.Matchers – Path expression $.serviceNode.entity.status.thirdNode['@description] is invalid, ignoring: [1.76] failure: '' expected but end of source found`

PACT framework is ingoring the rule due to invalid syntax and publish all interactions being passed in PACT broker.
Souldn't interactions that contains rules with invalid syntax to be marked as failed?
Because with the current behaviour is very hard to track each modification what we do in our pact file (we see all interactions had passed even tho there are some rules that were not executed due to invalid syntax)
Also if rule has invalid syntax would be more nice to have an ERROR logged instead of a WARN.

This might be related with changes performed in: #899

@vasile21 vasile21 changed the title Interactions that contains rules with invalid syntax are not marked as failed XmlBodyMatcher - Interactions that contains rules with invalid syntax are not marked as failed Oct 16, 2019
uglyog pushed a commit that referenced this issue Oct 27, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
susnux Ferdinand Thiessen
@uglyog uglyog added the bug Indicates an unexpected problem or unintended behavior label Oct 27, 2019
@uglyog uglyog closed this as completed Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants