I’m a new for karate, and i tried to use karate.proceed to “transition” the api to new Url. But i see the path can not overwrite in mock.feature.
Any suggestions?
for example:
MyTest.feature
Scenario: test mock
* url 'http://localhost:' + port + '/v1/hello/metoto'
* param name = 'lily'
* param age = 11
* method get
Mock.feature
Scenario: pathMatches('/{version}/{say}/{name}')
* def requestHeaders = { 'Authorization': 'Bearer 123'}
* def requestParams = {}
* def newurl = 'https://jsonplaceholder.typicode.com'
* karate.proceed(newurl)
then i found when karate.proceed run, it call the url as :
1 > GET https://jsonplaceholder.typicode.com/v1/hello/metoto
1 > Authorization: Bearer 123
1 > Host: jsonplaceholder.typicode.com
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.14 (Java/21.0.2)
1 > Accept-Encoding: gzip,deflate
but all i want is to ignore the old path :/v1/hello/metoto