Skip to content

Instantly share code, notes, and snippets.

@robertoduessmann
Last active February 10, 2021 22:24
Show Gist options
  • Select an option

  • Save robertoduessmann/d1481bfbaf1eb0194e6125dd0f291faf to your computer and use it in GitHub Desktop.

Select an option

Save robertoduessmann/d1481bfbaf1eb0194e6125dd0f291faf to your computer and use it in GitHub Desktop.
Feature: Create transaction and read balance
Background:
* url baseUrl
* def genUUID = function(){ return java.util.UUID.randomUUID() + '' }
* def userId = callonce genUUID
* def transactionRequest = { userId: '#(userId)', amount: 10 }
Scenario: Create transaction
* set transactionRequest.userId = userId
Given path '/transactions'
And request transactionRequest
And header Accept = 'application/json'
When method post
Then status 200
Scenario: Get balance
Given path '/balance/' + userId
And retry until responseStatus == 200
When method get
Then status 200
And match response.amount == 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment