-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts.http
More file actions
154 lines (121 loc) · 2.92 KB
/
products.http
File metadata and controls
154 lines (121 loc) · 2.92 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
########################################
# Environnement
########################################
# Dev environment
@baseUrl = http://localhost:8080
# Staging environment
#@baseUrl = https://products.localhost:5443
########################################
# Tests ProductResource V1
# IN MEMO ONLY
########################################
### GET all products V1
GET {{baseUrl}}/api/v1/products
Accept: application/json
### POST create product V1
POST {{baseUrl}}/api/v1/products
Content-Type: application/json
{
"sku": "P001",
"name": "Produit 1",
"price": 12.5,
"stock": 100
}
### POST create product V2
POST {{baseUrl}}/api/v1/products
Content-Type: application/json
{
"sku": "P002",
"name": "Produit 2",
"price": 15.0,
"stock": 10
}
### POST create product V1 conflict
POST {{baseUrl}}/api/v1/products
Content-Type: application/json
{
"sku": "P001",
"name": "Produit 1 bis",
"price": 15.0,
"stock": 50
}
########################################
# Tests ProductResource V2
########################################
### GET all products V2
GET {{baseUrl}}/api/v2/products
Accept: application/json
### GET product by SKU V2
GET {{baseUrl}}/api/v2/products/P001
Accept: application/json
### POST create product V2
POST {{baseUrl}}/api/v2/products
Content-Type: application/json
{
"sku": "P002",
"name": "Produit 2",
"price": 20.0,
"stock": 200
}
### DELETE product V2
DELETE {{baseUrl}}/api/v2/products/P002
########################################
# Tests ProductResource V3
########################################
### GET all products V3
GET {{baseUrl}}/api/v3/products
Accept: application/json
### GET product by SKU V3
GET {{baseUrl}}/api/v3/products/P001
Accept: application/json
### POST create product V3
POST {{baseUrl}}/api/v3/products
Content-Type: application/json
{
"sku": "P003",
"name": "Produit 3",
"price": 30.0,
"stock": 300
}
### DELETE product V3
DELETE {{baseUrl}}/api/v3/products/P003
########################################
# Tests ProductResource V4
########################################
### GET all products V4
GET {{baseUrl}}/api/v4/products
Accept: application/json
### GET product by SKU V4
GET {{baseUrl}}/api/v4/products/P001
Accept: application/json
### POST create product V4
POST {{baseUrl}}/api/v4/products
Content-Type: application/json
{
"sku": "P004",
"name": "Produit 4",
"price": 40.0,
"stock": 400
}
### DELETE product V4
DELETE {{baseUrl}}/api/v4/products/P004
########################################
# Tests ProductResource V5
########################################
### GET all products V5
GET {{baseUrl}}/api/v5/products
Accept: application/json
### GET product by SKU V5
GET {{baseUrl}}/api/v5/products/P001
Accept: application/json
### POST create product V5
POST {{baseUrl}}/api/v5/products
Content-Type: application/json
{
"sku": "P005",
"name": "Produit 5",
"price": 50.0,
"stock": 500
}
### DELETE product V5
DELETE {{baseUrl}}/api/v5/products/P005