Skip to content

Commit

Permalink
fix: swagger + more tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
youenchene committed Oct 5, 2023
1 parent d8521f3 commit 9ff38a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions service/EcobenchmarkBackEnd-0.0.1-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ components:
type: string
format: uuid
example: 276f6a6f-0afa-4e50-9e39-7130f5aea9d2
accountId:
account_id:
type: string
example: d290f1ee-6c54-4b01-90e6-d701748f0851
name:
type: string
example: My Task List
creationDate:
creation_date:
type: string
format: date-time
example: '2022-06-29T13:37:00.001Z'
Expand All @@ -213,7 +213,7 @@ components:
type: string
format: uuid
example: c6516320-e069-4238-a5c3-a57df2c1bc32
listId:
list_id:
type: string
example: 276f6a6f-0afa-4e50-9e39-7130f5aea9d2
name:
Expand All @@ -222,23 +222,23 @@ components:
description:
type: string
example: Just do it !
creationDate:
creation_date:
type: string
format: date-time
example: '2022-06-29T13:37:00.001Z'
AccountStatistic:
type: object
properties:
accountId:
account_id:
type: string
format: uuid
example: d290f1ee-6c54-4b01-90e6-d701748f0851
accountLogin:
account_login:
type: string
example: My Personal Account
listCount:
list_count:
type: number
example: 42
taskAvg:
task_avg:
type: number
example: 1337
7 changes: 4 additions & 3 deletions test/check-service-conformity.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Scenario: Simple Conformity Scenario - API Behavior and Cache agressive check
And request { name: #(task_name), description: #(task_description) }
When method post
Then match [200, 201, 204] contains responseStatus
Then match response contains { id: #uuid, name: #(task_name), description: #(task_description) , list_id: #(list_id) }
Then match response contains { id: #uuid, name: #(task_name), description: #(task_description)}
Then def task_id = response.id
# Check current list content
Given path 'api/accounts',account_id,'lists'
Expand All @@ -50,6 +50,7 @@ Scenario: Simple Conformity Scenario - API Behavior and Cache agressive check
Given path 'api/stats'
And header Content-Type = 'application/json'
When method get
Then print response
Then match [200, 201, 204] contains responseStatus
Then def sub_result = karate.filter(response, x => { return x.account_id == account_id } )
Then match sub_result[0] contains { account_id: #(account_id), account_login: #(account_name), list_count:1, task_avg:1 }
Expand All @@ -61,7 +62,7 @@ Scenario: Simple Conformity Scenario - API Behavior and Cache agressive check
And request { name: #(task_name_2), description: #(task_description_2) }
When method post
Then match [200, 201, 204] contains responseStatus
Then match response contains { id: #uuid, name: #(task_name_2), description: #(task_description_2) , list_id: #(list_id) }
Then match response contains { id: #uuid, name: #(task_name_2), description: #(task_description_2) }
Then def task_id_2 = response.id
# Check current list content - should be 2 tasks
Given path 'api/accounts',account_id,'lists'
Expand Down Expand Up @@ -103,7 +104,7 @@ Scenario: Simple Conformity Scenario - API Behavior and Cache agressive check
And request { name: #(task_name), description: #(task_description) }
When method post
Then match [200, 201, 204] contains responseStatus
Then match response contains { id: #uuid, name: #(task_name), description: #(task_description), list_id: #(list_id_2)}
Then match response contains { id: #uuid, name: #(task_name), description: #(task_description)}
Then def task_id_1_2 = response.id
# Check current lists content - should be 2 tasks
Given path 'api/accounts',account_id,'lists'
Expand Down

0 comments on commit 9ff38a1

Please sign in to comment.