Defining the test scenario

Every Gatling test suite should extend the Simulation class. In every test class, we may declare a list of scenarios using the Gatling Scala DSL. We usually declare the number of simultaneous threads that can call HTTP endpoints and the whole number of requests sent per single thread. In the Gatling nomenclature, the number of threads is determined by the number of users set using the atOnceUsers method. The test class should be placed in the src/test/scala directory.

Assuming that we would like to test two endpoints that are exposed by order-service running 20 clients, where each of them sends 500 requests sequentially, we would have 20,000 requests sent in total. By sending them all in a short period of time, ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.