Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit b21298e

Browse files
committed
Upgrade to 0.14.7, update links in README, use timeTakenMs for HTTP response validation
1 parent c57dab6 commit b21298e

14 files changed

Lines changed: 23 additions & 80 deletions

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM datacatering/data-caterer:0.14.6
1+
FROM datacatering/data-caterer:0.14.7
22

33
COPY --chown=app:app build/libs/data-caterer-example-0.1.0.jar /opt/app/job.jar

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ This repo contains example Java and Scala API usage for Data Caterer.
1414

1515
Check out any of [the Scala examples](src/main/scala/io/github/datacatering/plan) or
1616
[Java examples](src/main/java/io/github/datacatering/plan). If you are looking for more information, you can follow
17-
[**detailed documentation found here**](https://data.catering/setup/).
17+
[**detailed documentation found here**](https://data.catering/latest/docs/).
1818

1919
Not comfortable with Java or Scala? No worries.
20-
[You can use the UI via these steps](https://data.catering/get-started/quick-start/).
20+
[You can use the UI via these steps](https://data.catering/latest/get-started/quick-start/).
2121

2222
Want some YAML instead? Also, no worries. Check the example [plan](docker/data/custom/plan) and
2323
[task](docker/data/custom/task) YAML files here.
@@ -84,7 +84,7 @@ cd docker
8484
PLAN_CLASS=io.github.datacatering.plan.DocumentationPlanRun DATA_SOURCE=postgres docker-compose up -d datacaterer
8585
```
8686

87-
[Details from docs](https://data.catering/get-started/docker/).
87+
[Details from docs](https://data.catering/latest/get-started/quick-start/).
8888
Docker compose sample found under `docker` folder.
8989

9090
```shell

docker/mount/http/petstore.json

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -22,60 +22,6 @@
2222
],
2323
"paths": {
2424
"/pets": {
25-
"get": {
26-
"description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n",
27-
"operationId": "findPets",
28-
"parameters": [
29-
{
30-
"name": "tags",
31-
"in": "query",
32-
"description": "tags to filter by",
33-
"required": false,
34-
"style": "form",
35-
"schema": {
36-
"type": "array",
37-
"items": {
38-
"type": "string"
39-
}
40-
}
41-
},
42-
{
43-
"name": "limit",
44-
"in": "query",
45-
"description": "maximum number of results to return",
46-
"required": false,
47-
"schema": {
48-
"type": "integer",
49-
"format": "int32"
50-
}
51-
}
52-
],
53-
"responses": {
54-
"200": {
55-
"description": "pet response",
56-
"content": {
57-
"application/json": {
58-
"schema": {
59-
"type": "array",
60-
"items": {
61-
"$ref": "#/components/schemas/Pet"
62-
}
63-
}
64-
}
65-
}
66-
},
67-
"default": {
68-
"description": "unexpected error",
69-
"content": {
70-
"application/json": {
71-
"schema": {
72-
"$ref": "#/components/schemas/Error"
73-
}
74-
}
75-
}
76-
}
77-
}
78-
},
7925
"post": {
8026
"description": "Creates a new pet in the store. Duplicates are allowed",
8127
"operationId": "addPet",

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ version=0.1.0
88

99
scalaVersion=2.12
1010
scalaSpecificVersion=2.12.19
11-
dataCatererVersion=0.14.6
11+
dataCatererVersion=0.14.7
1212
sparkMajorVersion=3.5

helm/data-caterer/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ image:
88
repository: "datacatering/data-caterer"
99
pullPolicy: "IfNotPresent"
1010
# Overrides the image tag whose default is the chart appVersion.
11-
tag: "0.14.6"
11+
tag: "0.14.7"
1212

1313
imagePullSecrets: []
1414
nameOverride: ""

src/main/java/io/github/datacatering/plan/CsvGenerateIcebergValidateJavaPlan.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
package io.github.datacatering.plan;
22

3-
import io.github.datacatering.datacaterer.api.model.DateType;
4-
import io.github.datacatering.datacaterer.api.model.DecimalType;
5-
import io.github.datacatering.datacaterer.api.model.DoubleType;
6-
import io.github.datacatering.datacaterer.api.model.TimestampType;
73
import io.github.datacatering.datacaterer.javaapi.api.PlanRun;
84

9-
import java.util.List;
105
import java.util.Map;
116

127
public class CsvGenerateIcebergValidateJavaPlan extends PlanRun {

src/main/java/io/github/datacatering/plan/HttpOpenAPIJavaPlanRun.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class HttpOpenAPIJavaPlanRun extends PlanRun {
99
{
1010
var httpTask = http("my_http", Map.of(Constants.ROWS_PER_SECOND(), "1"))
1111
.fields(metadataSource().openApi("/opt/app/mount/http/petstore.json"))
12-
.fields(field().name("body").fields(field().name("id").regex("ID[0-9]{8}")))
12+
.fields(field().httpBody(field().name("id").regex("ID[0-9]{8}")))
1313
.count(count().records(2));
1414

1515
var myPlan = plan().addForeignKeyRelationship(

src/main/scala/io/github/datacatering/plan/CsvGenerateIcebergValidatePlan.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.datacatering.plan
22

33
import io.github.datacatering.datacaterer.api.PlanRun
4-
import io.github.datacatering.datacaterer.api.model.{DateType, DecimalType, DoubleType, TimestampType}
54

65
class CsvGenerateIcebergValidatePlan extends PlanRun {
76

src/main/scala/io/github/datacatering/plan/HttpOpenAPIPlanRun.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@ class HttpOpenAPIPlanRun extends PlanRun {
77

88
val httpTask = http("my_http", options = Map(ROWS_PER_SECOND -> "1"))
99
.fields(metadataSource.openApi("/opt/app/mount/http/petstore.json"))
10-
.fields(field.name("body").fields(field.name("id").regex("ID[0-9]{8}")))
10+
.fields(field.httpBody(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}"))
13+
val httpGetTask = http("my_http", options = Map(VALIDATION_IDENTIFIER -> "GET/pets/{id}"))
1414
.validations(
1515
validation.field("request.method").isEqual("GET"),
1616
validation.field("request.method").isEqualField("response.statusText"),
1717
validation.field("response.statusCode").isEqual(200),
18+
validation.field("response.timeTakenMs").lessThan(10),
1819
validation.field("response.headers.Content-Length").greaterThan(0),
1920
validation.field("response.headers.Content-Type").isEqual("application/json"),
2021
)
2122

2223
val myPlan = plan.addForeignKeyRelationship(
2324
foreignField("my_http", "POST/pets", "body.id"),
24-
foreignField("my_http", "DELETE/pets/{id}", "pathParamid"),
25-
foreignField("my_http", "GET/pets/{id}", "pathParamid")
25+
foreignField("my_http", "GET/pets/{id}", "pathParamid"),
26+
foreignField("my_http", "DELETE/pets/{id}", "pathParamid")
2627
)
2728

2829
val conf = configuration.enableGeneratePlanAndTasks(true)
2930
.generatedReportsFolderPath("/opt/app/data/report")
31+
.recordTrackingFolderPath("/opt/app/data/record-tracking")
32+
.recordTrackingForValidationFolderPath("/opt/app/data/record-tracking-valid")
3033

3134
execute(myPlan, conf, httpTask, httpGetTask)
3235
}

src/main/scala/io/github/datacatering/plan/HttpPlanRun.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ class HttpPlanRun extends PlanRun {
1111
.fields(field.httpUrl(
1212
"http://host.docker.internal:80/anything/pets", //url
1313
HttpMethodEnum.POST //method
14-
): _*)
14+
))
1515
.fields(
1616
field.httpBody(
1717
field.name("id").regex("[0-9]{8}"),
1818
field.name("name").expression("#{Name.name}"),
19-
): _*
19+
)
2020
)
2121
.count(count.records(10))
2222
.validations(
@@ -44,7 +44,7 @@ class HttpPlanRun extends PlanRun {
4444
List(
4545
field.name("limit").`type`(IntegerType).min(1).max(10) //query parameters
4646
)
47-
): _*
47+
)
4848
)
4949
.validations(
5050
validation.field("request.method").isEqual("GET"),

0 commit comments

Comments
 (0)