Simulator Path Variable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Simulator Path Variable

BlueHaze
This post was updated on .
I have the following scenario http mapping but I do not know how to access the userid path variable.

@RequestMapping(value = "/citrus-backend-server/user/{userid}", method = RequestMethod.GET)


The Spring @PathVariable String postcode annotation cannot be used in the overridden Scenario run(ScenarioRunner scenarioRunner) method.

Can anyone help?

If it isn't possible to directly access the userid path variable, is it possible to access the complete URL so that it can be parsed?

Many thanks

Reply | Threaded
Open this post in threaded view
|

Re: Simulator Path Variable

Sven Hettwer
Administrator
Hi!

Extracting path variable values is currently not supported by the simulator. It's possible to extract from the header and body via the fluent API within a AbstractSimulatorScenario implementation.

An example for the header extraction can be found here: https://github.com/citrusframework/citrus-simulator/blob/master/simulator-samples/sample-rest/src/main/java/com/consol/citrus/simulator/sample/scenario/GoodNightScenario.java
If you would like to propose a feature request, feel free to do so under https://github.com/citrusframework/citrus-simulator/issues.

BR,
Sven