-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pathMatches in mock is not working properly in karate version 1.2.0 #2028
Comments
tagging as again I'd like to remind everyone that this is why we release RC versions, to get this kind of feedback earlier instead of when it is too late. |
also found the same issue in 1.2.0 |
thanks @shaokunWang I investigated and found the problem. this only affects the "fatjar" users, so I've made a release only for that. can you confirm that the new version here works ? https://github.com/karatelabs/karate/releases/tag/v1.2.1.RC1 |
@ptrthomas It is working fine now with Karate version v1.2.1.RC1 |
@ptrthomas It is also working fine with Karate version v1.2.1.RC1 in my local machine. |
1.3.0 released |
Attached the below zip release with modified cats-mock.feature file which shows the issue.
Kindly use karate standalone jar 1.2.0.
karate-1.2.0.zip
Command used to run the mocks:
Run the below command from the place where karate jar is placed(jar location - karate-1.2.0\karate-1.2.0).
karate -p 8080 -m src/demo/mock/cats-mock.feature
Issue:
pathMatches in mock is ignoring the first character of the path added inside it. Please refer the below example.
Scenario: pathMatches('/cats') && methodIs('get')
* def response = { "mock" : "cats" }
If I hit http://localhost:8080/cats from postman, Karate is returning 404. Please refer the below screenshots.
If I hit http://localhost:8080/acats from postman, Karate is returning 200 and picking up the above mentioned mock. Please refer the below screenshots.
So it is picking up the incorrect mocks and since it is ignoring the first character path is not matched properly while using pathMatches.
Note: This functionality is working fine in 1.1.0
The text was updated successfully, but these errors were encountered: