jmeter-java-dsl
jmeter-java-dsl copied to clipboard
Integration with RestAssured
This is another feature 💯 . It would be nice to have a way to integrate with RestAssured to reuse the actual steps.
Hello @BojteTamasMO,
can you give an example of how you envision such integration?
Regards
if you have:
public void postCartItem(String payload) {
TestPlanStats stats =
testPlan(
threadGroup(
18,
10,
httpSampler("https")
.header("content-type", JSON.toString())
.header("Authorization", "Bearer " + getAccessToken())
.post(payload, MimeTypes.Type.APPLICATION_JSON)),
influxDbListener("http://localhost:8086/write?db=jmeter"),
// this is just to log details of each request stats
jtlWriter("test.jtl"))
.run();
assertThat(stats.overall().elapsedTimePercentile99()).isLessThan(Duration.ofSeconds(5));
can be nice to have a way to add in the request name or the link in the description
I still don't understand what is what you expect, and how the second comment relates to integrating with rest assured. Can you provide and example of expected jmeter-java-dsl or rest assured code and example of expected result?
Sorry for being unclear.
The request should be to have the httpSampler method with the type of parameter 'RequestSpecification', and there this library will get everything what it needs.
For example you have :
private RequestSpecification request(String url) {
return requestSpecification
.get()
.baseUri(url)
.contentType("application/vnd.api+json")
.accept(ContentType.JSON);
testPlan(threadGroup( 18, 10, httpSampler(request("url")).run()
Thank you,
I now understand what you are trying to achieve. Is this just an idea or do you have a specific requirement?
We could implement such feature, but seems to cover a very specific use case, which we will not invest efforts for the time being.
If this issue receives more votes we may consider implementing a jmeter-java-dsl to support this particular feature.
You are more than welcome to submit a pull request for such a feature if you like.
Regards, and thank you again for clarifying and proposing new ideas like this one.
This will be very nice feature to have.
Hi,
@BojteTamasMO, did you close this issue for any particular reason? Are you no longer interested in this feature? Maybe makes sense to keep the issue open to collect feedback from other potentially interested users and eventually (if there is enough interest), implement requested support.
Regards
I've thought that you have a lot of work and you don't have time.
Yes, thank you for your consideration. But, if enough interest arises in this matter I may re prioritize things.
Regards