-
Notifications
You must be signed in to change notification settings - Fork 138
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
Validating SQL with Hamcrest matchers throws OutOfBoundException #341
Comments
The problem here is the "," in the params array. Internally, the parameter attribute for nested matchers is derived by a simple split(","): String[] nestedMatcherParameter = matcherExpression.trim().substring(nestedMatcherName.length() + 1, matcherExpression.trim().length() - 1).split(","); This probably causes the problem. I have a similar issue and I will investigate on this. |
With the provided fix, the above issue can be tackled with:
which the perfectly matches this string:
Note that the actual matcher expression needs to be put into '' for proper parsing. |
…_matcher_expressions fix(#341): Allow comma and brackets in matcher expressions
Hi!
When I try to validate an SQL statement with hamcrest matchers via the citrus hamcrest integration, the parsing of the string expression fails with a
StringIndexOutOfBoundsException
in theHamcrestValidationMatcher
.I reduced the hamcrest matcher in the example to the essential part. So please don't wonder about the useless
allOf()
Example:
Stacktrace:
When I remove the braces, the test is successful
BR,
Sven
The text was updated successfully, but these errors were encountered: