You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of version 4.6.7 the .matchPath(regexp) method appears to validate the randomly generated path example with the regexp supplied. Prior to 4.6.7 no validation seems to be done.
The issue
The issue arises where the regexp contains certain meta-characters; e.g. ^ and $. These meta-characters are replayed into the generated random example and thus the example does not match the regexp.
e.g. regexp /pet/[0-9]+$ results in random examples like /pet/40552$
Version 4.6.7 onwards
Due to the change to the functionality of the matchPath(regexp) method, introducing checking of the example against the regexp, Consumer tests Error where the regexp contains ^ and/or $; e.g.
... .matchPath("/pet/[0-9]+$") InvalidMatcher Example "/pet/40552$" does not match regular expression "/pet/[0-9]+$"
Version 4.6.6 and prior
These incorrectly generated examples are encoded into the .pact file generated from the consumer test.
Root Cause
This appears to be due to the use of com.github.mifmif:generex:1.0.2 for the generation of the random strings from the provided regexp.
com.github.mifmif:generex:1.0.2is the latest version of this library that was released Oct 30, 2016 -- there does not appear to have been any further development or maintenance of this project.
This specific issue has been logged with the Generex project on several occasions, e.g. Aug 4, 2017, Feb 28, 2019, with no action taken.
The text was updated successfully, but these errors were encountered:
Background
As of version 4.6.7 the
.matchPath(regexp)
method appears to validate the randomly generated path example with the regexp supplied. Prior to 4.6.7 no validation seems to be done.The issue
The issue arises where the regexp contains certain meta-characters; e.g.
^
and$
. These meta-characters are replayed into the generated random example and thus the example does not match the regexp.e.g. regexp
/pet/[0-9]+$
results in random examples like/pet/40552$
Version 4.6.7 onwards
Due to the change to the functionality of the
matchPath(regexp)
method, introducing checking of the example against the regexp, Consumer tests Error where the regexp contains^
and/or$
; e.g.... .matchPath("/pet/[0-9]+$")
InvalidMatcher Example "/pet/40552$" does not match regular expression "/pet/[0-9]+$"
Version 4.6.6 and prior
These incorrectly generated examples are encoded into the
.pact
file generated from the consumer test.Root Cause
This appears to be due to the use of
com.github.mifmif:generex:1.0.2
for the generation of the random strings from the provided regexp.com.github.mifmif:generex:1.0.2
is the latest version of this library that was releasedOct 30, 2016
-- there does not appear to have been any further development or maintenance of this project.This specific issue has been logged with the Generex project on several occasions, e.g. Aug 4, 2017, Feb 28, 2019, with no action taken.
The text was updated successfully, but these errors were encountered: