1
votes

There is a way to read query parameters in service mock as for path params?

https://github.com/intuit/karate/blob/master/karate-netty/src/test/java/com/intuit/karate/server.feature

Thank you for any help!

1

1 Answers

2
votes

Yes. Read the docs: https://github.com/intuit/karate/tree/master/karate-netty#paramValue

Scenario: pathMatches('/greeting') && paramValue('name') != null
    * def content = 'Hello ' + paramValue('name') + '!'
    * def response = { id: '#(nextId())', content: '#(content)' }