diff --git a/src/main/java/io/github/datacatering/plan/HttpJavaPlanRun.java b/src/main/java/io/github/datacatering/plan/HttpJavaPlanRun.java index 3e1dfbb..e586391 100644 --- a/src/main/java/io/github/datacatering/plan/HttpJavaPlanRun.java +++ b/src/main/java/io/github/datacatering/plan/HttpJavaPlanRun.java @@ -10,7 +10,7 @@ public class HttpJavaPlanRun extends PlanRun { { - var httpTask = http("my_http", Map.of(Constants.ROWS_PER_SECOND(), "1")) + var httpTask = http("my_http", Map.of(Constants.ROWS_PER_SECOND(), "1", Constants.VALIDATION_IDENTIFIER(), "POST/pets")) .fields( field().httpHeader("Content-Type").staticValue("application/json"), field().httpHeader("Content-Length"), @@ -33,6 +33,13 @@ public class HttpJavaPlanRun extends PlanRun { ) ) ) + .validations( + validation().field("request.method").isEqual("POST"), + validation().field("response.statusCode").isEqual(200), + validation().field("response.timeTaken").lessThan(100), + validation().field("response.headers.Content-Length").greaterThan(0), + validation().field("response.headers.Content-Type").isEqual("application/json") + ) .count(count().records(2)); var conf = configuration() diff --git a/src/main/scala/io/github/datacatering/plan/HttpPlanRun.scala b/src/main/scala/io/github/datacatering/plan/HttpPlanRun.scala index 09a1699..9a4c9cf 100644 --- a/src/main/scala/io/github/datacatering/plan/HttpPlanRun.scala +++ b/src/main/scala/io/github/datacatering/plan/HttpPlanRun.scala @@ -23,6 +23,7 @@ class HttpPlanRun extends PlanRun { validation.field("request.method").isEqual("POST"), validation.field("request.method").isEqualField("response.statusText"), validation.field("response.statusCode").isEqual(200), + validation.field("response.timeTaken").lessThan(100), validation.field("response.headers.Content-Length").greaterThan(0), validation.field("response.headers.Content-Type").isEqual("application/json"), )