11package io .github .datacatering .plan
22
33import io .github .datacatering .datacaterer .api .PlanRun
4- import io .github .datacatering .datacaterer .api .model .Constants .ROWS_PER_SECOND
4+ import io .github .datacatering .datacaterer .api .model .Constants .{ ROWS_PER_SECOND , VALIDATION_IDENTIFIER }
55
66class AdvancedHttpPlanRun extends PlanRun {
77
@@ -10,6 +10,15 @@ class AdvancedHttpPlanRun extends PlanRun {
1010 .schema(field.name(" bodyContent" ).schema(field.name(" id" ).regex(" ID[0-9]{8}" )))
1111 .count(count.records(2 ))
1212
13+ val httpGetTask = http(" get_http" , options = Map (VALIDATION_IDENTIFIER -> " GET/pets/{id}" ))
14+ .validations(
15+ validation.col(" request.method" ).isEqual(" GET" ),
16+ validation.col(" request.method" ).isEqualCol(" response.statusText" ),
17+ validation.col(" response.statusCode" ).isEqual(200 ),
18+ validation.col(" response.headers.Content-Length" ).greaterThan(0 ),
19+ validation.col(" response.headers.Content-Type" ).isEqual(" application/json" ),
20+ )
21+
1322 val myPlan = plan.addForeignKeyRelationship(
1423 foreignField(" my_http" , " POST/pets" , " bodyContent.id" ),
1524 foreignField(" my_http" , " DELETE/pets/{id}" , " pathParamid" ),
@@ -19,5 +28,5 @@ class AdvancedHttpPlanRun extends PlanRun {
1928 val conf = configuration.enableGeneratePlanAndTasks(true )
2029 .generatedReportsFolderPath(" /opt/app/data/report" )
2130
22- execute(myPlan, conf, httpTask)
31+ execute(myPlan, conf, httpTask, httpGetTask )
2332}
0 commit comments