Skip to content
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

The request "path" can not be overwrited in mock.feature #2556

Open
tdhanjun opened this issue Apr 24, 2024 · 0 comments
Open

The request "path" can not be overwrited in mock.feature #2556

tdhanjun opened this issue Apr 24, 2024 · 0 comments

Comments

@tdhanjun
Copy link

I tried to use karate.proceed to "transition" the api to new Url with "Proxy mode".

But i see the request path can not overwrite.

What I tried is like this:

testScenario.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 requestPath = '/'
    * def newurl = 'https://jsonplaceholder.typicode.com'
    * karate.proceed(newurl)

The requestHeaders and requestParams can be overwritten correctly, but the requestPath would encounter the issue :

09:23:25.412 [armeria-common-worker-kqueue-3-4] DEBUG c.intuit.karate.core.ScenarioEngine - over-writing existing variable 'requestHeaders' with new value: { 'Authorization': 'Bearer 123'}
09:23:25.413 [armeria-common-worker-kqueue-3-4] DEBUG c.intuit.karate.core.ScenarioEngine - over-writing existing variable 'requestParams' with new value: {name: ['John'], age: ['60']}
09:23:25.425 [armeria-common-worker-kqueue-3-4] ERROR com.intuit.karate - server-side scenario failed, /Users/metoto/karate_test/karate_training/src/test/java/support/utils/mock.feature:51
* def requestPath ='/'
no step-definition method match found for: def requestPath ='/'

I'm not sure if something is wrong in my code. or is this an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant