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

Integration with RestAssured #3

Open
BojteTamasMO opened this issue Oct 29, 2020 · 9 comments
Open

Integration with RestAssured #3

BojteTamasMO opened this issue Oct 29, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@BojteTamasMO
Copy link

This is another feature 💯 .
It would be nice to have a way to integrate with RestAssured to reuse the actual steps.

@rabelenda
Copy link
Contributor

Hello @BojteTamasMO,

can you give an example of how you envision such integration?

Regards

@BojteTamasMO
Copy link
Author

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

@rabelenda
Copy link
Contributor

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?

@BojteTamasMO
Copy link
Author

BojteTamasMO commented Nov 3, 2020

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()

@rabelenda
Copy link
Contributor

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.

@aabirdaneshyar
Copy link

This will be very nice feature to have.

@rabelenda
Copy link
Contributor

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

@BojteTamasMO BojteTamasMO reopened this Jan 8, 2021
@BojteTamasMO
Copy link
Author

I've thought that you have a lot of work and you don't have time.

@rabelenda
Copy link
Contributor

Yes, thank you for your consideration. But, if enough interest arises in this matter I may re prioritize things.

Regards

@rabelenda rabelenda added the enhancement New feature or request label Oct 29, 2021
alexivimeydal added a commit to alexivimeydal/jmeter-java-dsl that referenced this issue Jul 12, 2024
… along with constant property value. Updated its usages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants