diff --git a/src/contractTest/resources/contracts/data-delete-contract.kts b/src/contractTest/resources/contracts/data-delete-contract.kts index 25210ae..df366ef 100644 --- a/src/contractTest/resources/contracts/data-delete-contract.kts +++ b/src/contractTest/resources/contracts/data-delete-contract.kts @@ -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")) } @@ -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")) } diff --git a/src/contractTest/resources/contracts/data-get-by-id-contract.kts b/src/contractTest/resources/contracts/data-get-by-id-contract.kts index 4bc23a8..081e62d 100644 --- a/src/contractTest/resources/contracts/data-get-by-id-contract.kts +++ b/src/contractTest/resources/contracts/data-get-by-id-contract.kts @@ -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")) } @@ -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")) } diff --git a/src/contractTest/resources/contracts/data-get-contract.kts b/src/contractTest/resources/contracts/data-get-contract.kts index b68f6ec..e5e1058 100644 --- a/src/contractTest/resources/contracts/data-get-contract.kts +++ b/src/contractTest/resources/contracts/data-get-contract.kts @@ -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")) } @@ -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")) } diff --git a/src/contractTest/resources/contracts/data-save-contract.kts b/src/contractTest/resources/contracts/data-save-contract.kts index db8e778..30b491f 100644 --- a/src/contractTest/resources/contracts/data-save-contract.kts +++ b/src/contractTest/resources/contracts/data-save-contract.kts @@ -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")) } @@ -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")) }