Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/test/java/com/github/jaguililla/appointments/GatlingSimulation.java
  • Loading branch information
jaguililla committed Sep 30, 2024
2 parents 4bf26ef + 4b8fa06 commit cfe887b
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import io.gatling.javaapi.core.*;

import java.util.Map;
import java.util.UUID;
import java.util.stream.Stream;

public class GatlingSimulation extends Simulation {

private ChainBuilder appointmentsList = exec(
Expand All @@ -19,8 +23,9 @@ public class GatlingSimulation extends Simulation {
.header("Content-Type", "application/json")
.body(StringBody("""
{
"startTimestamp": "2024-09-28T21:28:00.419367341",
"endTimestamp": "2024-09-28T21:28:00.4193957"
"id": "#{id}",
"startTimestamp": "2024-09-28T21:28:00",
"endTimestamp": "2024-09-28T21:28:00"
}
"""
))
Expand All @@ -39,6 +44,13 @@ public class GatlingSimulation extends Simulation {
{
var baseUrl = "http://localhost:18080";
var httpProtocol = http.baseUrl(baseUrl);
var feeder = Stream
.generate(UUID::randomUUID)
.map(UUID::toString)
.<Map<String, Object>>map(it -> Map.of("id", it))
.iterator();

var users = scenario("Appointments").feed(feeder).exec(appointmentsCrud);
var crud = scenario("Appointments CRUD").exec(appointmentsCrud);
var list = scenario("Appointments List").exec(appointmentsList);

Expand Down

0 comments on commit cfe887b

Please sign in to comment.