forked from karatelabs/karate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment-contract.feature
executable file
·35 lines (27 loc) · 1.01 KB
/
payment-contract.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Feature: payment service contract test
Background:
* url paymentServiceUrl + '/payments'
Scenario: create, get, update, list and delete payments
Given request { amount: 5.67, description: 'test one' }
When method post
Then status 200
And match response == { id: '#number', amount: 5.67, description: 'test one' }
And def id = response.id
Given path id
When method get
Then status 200
And match response == { id: '#(id)', amount: 5.67, description: 'test one' }
Given path id
And request { id: '#(id)', amount: 5.67, description: 'test two' }
When method put
Then status 200
And match response == { id: '#(id)', amount: 5.67, description: 'test two' }
When method get
Then status 200
And match response contains { id: '#(id)', amount: 5.67, description: 'test two' }
Given path id
When method delete
Then status 200
When method get
Then status 200
And match response !contains { id: '#(id)', amount: '#number', description: '#string' }