Last active
February 10, 2021 22:24
-
-
Save robertoduessmann/d1481bfbaf1eb0194e6125dd0f291faf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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