citrusframework / citrus-simulator-demo

Citrus simulator demo
Apache License 2.0
2 stars 1 forks source link

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

Open developer-c0d3r-io opened 2 years ago

developer-c0d3r-io commented 2 years ago

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 commented 1 month ago

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