2022-02-13 22:51:09 +01:00
|
|
|
{
|
|
|
|
"info": {
|
|
|
|
"_postman_id": "55c48bb4-3ec9-4f48-877d-1450270b603d",
|
|
|
|
"name": "MealHomeWork",
|
|
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
|
|
},
|
|
|
|
"item": [
|
|
|
|
{
|
|
|
|
"name": "Load a meal",
|
2022-02-13 22:58:05 +01:00
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"exec": [
|
|
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
|
|
" pm.response.to.have.status(204);",
|
|
|
|
"});"
|
|
|
|
],
|
|
|
|
"type": "text/javascript"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2022-02-13 22:51:09 +01:00
|
|
|
"request": {
|
|
|
|
"method": "POST",
|
|
|
|
"header": [],
|
|
|
|
"body": {
|
|
|
|
"mode": "raw",
|
|
|
|
"raw": "{\n \"name\": \"Paprikas krumpli\",\n \"description\": \"Mit csinaljak? Paprikas krumplit!\",\n \"kcal\": 400,\n \"price\": 1500,\n \"spicy\": true,\n \"vegan\": true,\n \"glutenfree\": true,\n \"ingredients\": [\n {\n \"name\": \"Paprika\"\n },\n {\n \"name\": \"Krumpli\"\n }\n ]\n}",
|
|
|
|
"options": {
|
|
|
|
"raw": {
|
|
|
|
"language": "json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"raw": "{{HOST}}/meals",
|
|
|
|
"host": [
|
|
|
|
"{{HOST}}"
|
|
|
|
],
|
|
|
|
"path": [
|
|
|
|
"meals"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Update a meal",
|
2022-02-13 22:58:05 +01:00
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"exec": [
|
|
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
|
|
" pm.response.to.have.status(200);",
|
|
|
|
"});"
|
|
|
|
],
|
|
|
|
"type": "text/javascript"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2022-02-13 22:51:09 +01:00
|
|
|
"request": {
|
2022-02-13 22:58:05 +01:00
|
|
|
"method": "PUT",
|
2022-02-13 22:51:09 +01:00
|
|
|
"header": [],
|
|
|
|
"body": {
|
|
|
|
"mode": "raw",
|
|
|
|
"raw": "{\n \"name\": \"Paprikas krumpli\",\n \"description\": \"Mit csinaljak? Krumplikas paprit!\",\n \"kcal\": 350,\n \"price\": 200,\n \"spicy\": false,\n \"vegan\": true,\n \"glutenfree\": true,\n \"ingredients\": [\n {\n \"name\": \"Papri\"\n },\n {\n \"name\": \"Krumplika\"\n }\n ]\n}",
|
|
|
|
"options": {
|
|
|
|
"raw": {
|
|
|
|
"language": "json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"raw": "{{HOST}}/meals/2",
|
|
|
|
"host": [
|
|
|
|
"{{HOST}}"
|
|
|
|
],
|
|
|
|
"path": [
|
|
|
|
"meals",
|
|
|
|
"2"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Get all meals",
|
2022-02-13 22:58:05 +01:00
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"exec": [
|
|
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
|
|
" pm.response.to.have.status(200);",
|
|
|
|
"});"
|
|
|
|
],
|
|
|
|
"type": "text/javascript"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2022-02-13 22:51:09 +01:00
|
|
|
"request": {
|
|
|
|
"method": "GET",
|
|
|
|
"header": [],
|
|
|
|
"url": {
|
|
|
|
"raw": "{{HOST}}/meals",
|
|
|
|
"host": [
|
|
|
|
"{{HOST}}"
|
|
|
|
],
|
|
|
|
"path": [
|
|
|
|
"meals"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Get a specific meal",
|
2022-02-13 22:58:05 +01:00
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"exec": [
|
|
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
|
|
" pm.response.to.have.status(200);",
|
|
|
|
"});"
|
|
|
|
],
|
|
|
|
"type": "text/javascript"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2022-02-13 22:51:09 +01:00
|
|
|
"request": {
|
|
|
|
"method": "GET",
|
|
|
|
"header": [],
|
|
|
|
"url": {
|
|
|
|
"raw": "{{HOST}}/meals/1",
|
|
|
|
"host": [
|
|
|
|
"{{HOST}}"
|
|
|
|
],
|
|
|
|
"path": [
|
|
|
|
"meals",
|
|
|
|
"1"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Delete a specific meal",
|
2022-02-13 22:58:05 +01:00
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"exec": [
|
|
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
|
|
" pm.response.to.have.status(200);",
|
|
|
|
"});"
|
|
|
|
],
|
|
|
|
"type": "text/javascript"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2022-02-13 22:51:09 +01:00
|
|
|
"request": {
|
|
|
|
"method": "DELETE",
|
|
|
|
"header": [],
|
|
|
|
"url": {
|
|
|
|
"raw": "{{HOST}}/meals/1",
|
|
|
|
"host": [
|
|
|
|
"{{HOST}}"
|
|
|
|
],
|
|
|
|
"path": [
|
|
|
|
"meals",
|
|
|
|
"1"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"event": [
|
|
|
|
{
|
|
|
|
"listen": "prerequest",
|
|
|
|
"script": {
|
|
|
|
"type": "text/javascript",
|
|
|
|
"exec": [
|
|
|
|
""
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"listen": "test",
|
|
|
|
"script": {
|
|
|
|
"type": "text/javascript",
|
|
|
|
"exec": [
|
|
|
|
""
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"variable": [
|
|
|
|
{
|
|
|
|
"key": "HOST",
|
|
|
|
"value": "127.0.0.1:8080",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|