1
votes

At the moment, I'm using two different frameworks for REST APIs integration testing, and load/stress testing. Respectively : geb (or cucumber) and gatling. But most of the time, I'm re-writing some pieces of code in load / performance scenarii that I've been writing for integration testing.

So the question is : is there a framework (running on the JVM) or simply a way, to write integration tests (for a strict REST API use case), preferably programmatically, then assemble load testing scenarios using these integration tests.

I've read cucumber maybe could do that, but I'm lacking a proper example.

The requirements :

  • write integration tests programmatically

  • for any integration test, have the ability to "extract" values (the same way gatling can extract json paths for instance)

  • assemble the integration tests in a load test scenario

If anyone has some experience to share, I'd be happy to read any blog article, GitHub repository, or whatever source dealing with such an approach.

Thanks in advance for your help.

1

1 Answers

1
votes

It sounds like you want to extract a library that you use both for your integration tests as well as your load test.

Both tools you are referring to are able to use external jar.

Suppose that you use Maven or Gradle as build tool, create a new module that you refer to from both your integration tests and your load tests. Place all interaction logic in this new module. This should allow you to reuse the code you need.