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

Unable to extract URL/Path param within test scenario #1

Open
developer-c0d3r-io opened this issue Jul 9, 2022 · 1 comment
Open

Comments

@developer-c0d3r-io
Copy link

Hi,

Per your example within the README how would you extract the username URL/Path param. I've reviewed the code samples and read through the documentation and debugged through my own simulator and I've been unable to work out how to obtain these values.

For a simulator is likely important that the simulated objects returned include the inbound values. I think I've seen examples where the query params are extracted. So unclear what options exist for url/path params.

@Scenario("GET_USER")
@RequestMapping(value = "/services/rest/v1/user/{username}", method = RequestMethod.GET)
public class GetUserScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioDesigner scenario) {
    scenario
        .http()
        .receive()
        .get();

    scenario
        .http()
        .send()
        .response(HttpStatus.OK)
        .payload(new ClassPathResource("random-user.json"));
}

}

Regards

Russell

@NeoMaster101
Copy link

NeoMaster101 commented Sep 19, 2024

I also need the same, there is no mention of path variable extraction in any of the documents.
@christophd please help

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

2 participants