Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cjaehnen committed Sep 2, 2024
1 parent a302078 commit 1bfb01a
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 91 deletions.
24 changes: 13 additions & 11 deletions src/contractTest/resources/contracts/data-delete-contract.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"name" to "products",
"id" to "82a94d9f-894c-4c00-ba40-a36e8f55f842",
),
)
body =
body(
mapOf(
"name" to "products",
"id" to "82a94d9f-894c-4c00-ba40-a36e8f55f842",
),
)
bodyMatchers {
jsonPath("$.name", byRegex("products"))
}
Expand All @@ -26,11 +27,12 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"message" to "Data deleted",
),
)
body =
body(
mapOf(
"message" to "Data deleted",
),
)
bodyMatchers {
jsonPath("$.message", byRegex("Data deleted"))
}
Expand Down
33 changes: 18 additions & 15 deletions src/contractTest/resources/contracts/data-get-by-id-contract.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"name" to "products",
"id" to "82a94d9f-894c-4c00-ba40-a36e8f55f842",
),
)
body =
body(
mapOf(
"name" to "products",
"id" to "82a94d9f-894c-4c00-ba40-a36e8f55f842",
),
)
bodyMatchers {
jsonPath("$.name", byRegex("products"))
}
Expand All @@ -26,16 +27,18 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"state" to "SUCCESS",
"message" to "Data retrieved",
"data" to mapOf(
"product_id" to 1,
"name" to "Product 1",
body =
body(
mapOf(
"state" to "SUCCESS",
"message" to "Data retrieved",
"data" to
mapOf(
"product_id" to 1,
"name" to "Product 1",
),
),
),
)
)
bodyMatchers {
jsonPath("$.message", byRegex("Data retrieved"))
}
Expand Down
102 changes: 56 additions & 46 deletions src/contractTest/resources/contracts/data-get-contract.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,39 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"name" to "products",
"filter" to mapOf(
"params" to listOf(
body =
body(
mapOf(
"name" to "products",
"filter" to
mapOf(
"name" to "product_name",
"value" to "Product 1",
"type" to "EQUALS",
"condition" to "AND",
"params" to
listOf(
mapOf(
"name" to "product_name",
"value" to "Product 1",
"type" to "EQUALS",
"condition" to "AND",
),
),
),
),
),
"page" to mapOf(
"index" to 0,
"size" to 1,
),
"sort" to mapOf(
"params" to listOf(
"page" to
mapOf(
"index" to 0,
"size" to 1,
),
"sort" to
mapOf(
"name" to "product_name",
"direction" to "ASC",
"params" to
listOf(
mapOf(
"name" to "product_name",
"direction" to "ASC",
),
),
),
),
),
),
)
)
bodyMatchers {
jsonPath("$.name", byRegex("products"))
}
Expand All @@ -47,31 +53,35 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"state" to "SUCCESS",
"message" to "Data retrieved",
"pages" to mapOf(
"state" to "PAGINATED",
"index" to 0,
"size" to 2,
"count" to 1,
),
"records" to mapOf(
"total" to 2,
),
"data" to listOf(
mapOf(
"product_id" to 1,
"name" to "Product 1",
),
mapOf(
"product_id" to 2,
"name" to "Product 2",
),
body =
body(
mapOf(
"state" to "SUCCESS",
"message" to "Data retrieved",
"pages" to
mapOf(
"state" to "PAGINATED",
"index" to 0,
"size" to 2,
"count" to 1,
),
"records" to
mapOf(
"total" to 2,
),
"data" to
listOf(
mapOf(
"product_id" to 1,
"name" to "Product 1",
),
mapOf(
"product_id" to 2,
"name" to "Product 2",
),
),
),
),
)
)
bodyMatchers {
jsonPath("$.message", byRegex("Data retrieved"))
}
Expand Down
42 changes: 23 additions & 19 deletions src/contractTest/resources/contracts/data-save-contract.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"name" to "products",
"data" to listOf(
mapOf(
"name" to "Product 1",
),
body =
body(
mapOf(
"name" to "products",
"data" to
listOf(
mapOf(
"name" to "Product 1",
),
),
),
),
)
)
bodyMatchers {
jsonPath("$.name", byRegex("products"))
}
Expand All @@ -30,17 +32,19 @@ contract {
headers {
contentType = "application/json"
}
body = body(
mapOf(
"message" to "Data saved",
"data" to listOf(
mapOf(
"product_id" to 1,
"name" to "Product 1",
),
body =
body(
mapOf(
"message" to "Data saved",
"data" to
listOf(
mapOf(
"product_id" to 1,
"name" to "Product 1",
),
),
),
),
)
)
bodyMatchers {
jsonPath("$.message", byRegex("Data saved"))
}
Expand Down

0 comments on commit 1bfb01a

Please sign in to comment.