|
1 | 1 | Feature: Testing a REST API with Karate
|
2 | 2 |
|
3 | 3 | Scenario: Testing valid GET endpoint
|
4 |
| - Given url 'http://localhost:8080/user/get' |
| 4 | + Given url 'http://localhost:8097/user/get' |
5 | 5 | When method GET
|
6 | 6 | Then status 200
|
7 | 7 |
|
8 | 8 | Scenario: Testing an invalid GET endpoint - 404
|
9 |
| - Given url 'http://localhost:8080/user/wrong' |
| 9 | + Given url 'http://localhost:8097/user/wrong' |
10 | 10 | When method GET
|
11 | 11 | Then status 404
|
12 | 12 |
|
13 | 13 | Scenario: Testing the exact response of a GET endpoint
|
14 |
| - Given url 'http://localhost:8080/user/get' |
| 14 | + Given url 'http://localhost:8097/user/get' |
15 | 15 | When method GET
|
16 | 16 | Then status 200
|
17 | 17 | And match $ == {id:"1234",name:"John Smith"}
|
18 | 18 |
|
19 | 19 | Scenario: Testing the exact response field value of a GET endpoint
|
20 |
| - Given url 'http://localhost:8080/user/get' |
| 20 | + Given url 'http://localhost:8097/user/get' |
21 | 21 | When method GET
|
22 | 22 | Then status 200
|
23 | 23 | And match $.id == "1234"
|
24 | 24 |
|
25 | 25 | Scenario: Testing that GET response contains specific field
|
26 |
| - Given url 'http://localhost:8080/user/get' |
| 26 | + Given url 'http://localhost:8097/user/get' |
27 | 27 | When method GET
|
28 | 28 | Then status 200
|
29 | 29 | And match $ contains {id:"1234"}
|
30 | 30 |
|
31 | 31 | Scenario: Test GET response using markers
|
32 |
| - Given url 'http://localhost:8080/user/get' |
| 32 | + Given url 'http://localhost:8097/user/get' |
33 | 33 | When method GET
|
34 | 34 | Then status 200
|
35 | 35 | And match $ == {id:"#notnull",name:"John Smith"}
|
36 | 36 |
|
37 | 37 | Scenario: Testing a POST endpoint with request body
|
38 |
| - Given url 'http://localhost:8080/user/create' |
| 38 | + Given url 'http://localhost:8097/user/create' |
39 | 39 | And request { id: '1234' , name: 'John Smith'}
|
40 | 40 | When method POST
|
41 | 41 | Then status 200
|
|
0 commit comments