{"info":{"_postman_id":"d721e8bb-9ab6-490a-926d-ab10f2c93ddf","name":"REST API - Task Manager","description":"<html><head></head><body><p>A task management providing functionality for adding, updating, deleting, and retrieving tasks. This service offers a RESTful API for managing tasks.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"32032637","collectionId":"d721e8bb-9ab6-490a-926d-ab10f2c93ddf","publishedId":"2sA3s3GAhh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-08-09T13:48:14.000Z"},"item":[{"name":"GetAllTasks","id":"a83f8b5a-3439-4627-ae2c-62917759c558","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDc5OTEsImlzX2FkbWluIjpmYWxzZSwidXNlcm5hbWUiOiJiZWthIn0.QoEWIn4FPI2kVK4UfIt6J8k1ezKV9sK3s6AsB8JQbgk","type":"text"}],"url":"localhost:8080/tasks","description":"<p>This endpoint makes an HTTP GET request to localhost:8080/tasks to retrieve a list of tasks. The request does not include a request body.</p>\n<h3 id=\"expected-response\">Expected Response</h3>\n<p>The response will have a status code of 200 and a content type of application/json. The response body will be an array of task objects, each containing the following fields:</p>\n<ul>\n<li><p><code>id</code> (string): The unique identifier for the task.</p>\n</li>\n<li><p><code>title</code> (string): The title or name of the task.</p>\n</li>\n<li><p><code>description</code> (string): A description of the task.</p>\n</li>\n<li><p><code>due_date</code> (string): The date by which the task is due.</p>\n</li>\n<li><p><code>status</code> (string): The status of the task.</p>\n</li>\n</ul>\n<h4 id=\"example-response-body\">Example Response Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"id\": \"\",\n        \"title\": \"\",\n        \"description\": \"\",\n        \"due_date\": \"\",\n        \"status\": \"\"\n    }\n]\n\n</code></pre>\n<h3 id=\"authorization\">Authorization</h3>\n<p>Include an authorization header in the request with the correct bearer token.</p>\n<h3 id=\"expected-response-1\">Expected Response</h3>\n<p>The response will have a status code of 200 and a content type of application/json. The response body will be an array of task objects, each containing the following fields:</p>\n<ul>\n<li><p><code>id</code> (string): The unique identifier for the task.</p>\n</li>\n<li><p><code>title</code> (string): The title or name of the task.</p>\n</li>\n<li><p><code>description</code> (string): A description of the task.</p>\n</li>\n<li><p><code>due_date</code> (string): The date by which the task is due.</p>\n</li>\n<li><p><code>status</code> (string): The status of the task.</p>\n</li>\n</ul>\n<h4 id=\"example-response-body-1\">Example Response Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"id\": \"\",\n        \"title\": \"\",\n        \"description\": \"\",\n        \"due_date\": \"\",\n        \"status\": \"\"\n    }\n]\n\n</code></pre>\n","urlObject":{"port":"8080","path":["tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"504285ba-9198-4e81-a5c5-ffc6238a0f9d","name":"GetAllTasks","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjM0OjE3Ljg4NjUzMzkrMDM6MDAiLCJpc19hZG1pbiI6ZmFsc2UsInVzZXJuYW1lIjoiYmVrYSJ9._jCyU4eSEOkuBk8Z4FAL6tCCGyXTEP7TIiJsuoIqQEE","type":"text"}],"url":"localhost:8080/tasks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Tue, 06 Aug 2024 11:40:19 GMT"},{"key":"Content-Length","value":"550"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"1\",\n        \"title\": \"Task 1\",\n        \"description\": \"First task\",\n        \"due_date\": \"2024-08-06T14:40:10.331133+03:00\",\n        \"status\": \"Pending\"\n    },\n    {\n        \"id\": \"2\",\n        \"title\": \"Task 2\",\n        \"description\": \"Second task\",\n        \"due_date\": \"2024-08-07T14:40:10.331133+03:00\",\n        \"status\": \"In Progress\"\n    },\n    {\n        \"id\": \"3\",\n        \"title\": \"Task 3\",\n        \"description\": \"Third task\",\n        \"due_date\": \"2024-08-08T14:40:10.3316756+03:00\",\n        \"status\": \"Completed\"\n    }\n]"}],"_postman_id":"a83f8b5a-3439-4627-ae2c-62917759c558"},{"name":"GetTaskByID","id":"e04c66a3-bd97-40b3-bea5-171e2bff4131","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDc5OTEsImlzX2FkbWluIjpmYWxzZSwidXNlcm5hbWUiOiJiZWthIn0.QoEWIn4FPI2kVK4UfIt6J8k1ezKV9sK3s6AsB8JQbgk","type":"text"}],"url":"localhost:8080/tasks/:id","description":"<p>This endpoint retrieves a specific task by its ID and requires the authorization header with a bearer token.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p>Method: GET</p>\n</li>\n<li><p>Endpoint: <code>localhost:8080/tasks/:id</code></p>\n</li>\n<li><p>Headers:</p>\n<ul>\n<li>Authorization: Bearer {token}</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n<li><p>{ \"id\": \"\", \"title\": \"\", \"description\": \"\", \"due_date\": \"\", \"status\": \"\"}</p>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"\",\n    \"title\": \"\",\n    \"description\": \"\",\n    \"due_date\": \"\",\n    \"status\": \"\"\n}\n\n</code></pre>\n<h3 id=\"request-1\">Request</h3>\n<ul>\n<li><p>Method: GET</p>\n</li>\n<li><p>Endpoint: <code>localhost:8080/tasks/:id</code></p>\n</li>\n</ul>\n<h3 id=\"response-1\">Response</h3>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n<li><p>{ \"id\": \"\", \"title\": \"\", \"description\": \"\", \"due_date\": \"\", \"status\": \"\"}</p>\n</li>\n</ul>\n<h4 id=\"example-response-1\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"\",\n    \"title\": \"\",\n    \"description\": \"\",\n    \"due_date\": \"\",\n    \"status\": \"\"\n}\n\n</code></pre>\n<h3 id=\"request-2\">Request</h3>\n<ul>\n<li><p>Method: GET</p>\n</li>\n<li><p>Endpoint: <code>localhost:8080/tasks/:id</code></p>\n</li>\n</ul>\n<h3 id=\"response-2\">Response</h3>\n<ul>\n<li><p>Status: 200</p>\n</li>\n<li><p>Content-Type: application/json</p>\n</li>\n<li><p>{ \"id\": \"\", \"title\": \"\", \"description\": \"\", \"due_date\": \"\", \"status\": \"\"}</p>\n</li>\n</ul>\n<h4 id=\"example-response-2\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"\",\n    \"title\": \"\",\n    \"description\": \"\",\n    \"due_date\": \"\",\n    \"status\": \"\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["tasks",":id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"390d8ab7-64a0-4fdd-b959-09ea67ca2f4e","key":"id"}]}},"response":[{"id":"9639b591-23b8-46ea-b667-f3782a69bfdd","name":"GetTaskByID failure","originalRequest":{"method":"GET","header":[],"url":{"raw":"localhost:8080/tasks/:id","host":["localhost"],"port":"8080","path":["tasks",":id"],"variable":[{"key":"id","value":"10"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Tue, 06 Aug 2024 12:01:15 GMT"},{"key":"Content-Length","value":"33"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Task Not Found\"\n}"},{"id":"777eeca3-d8b7-49db-ad11-6dd174b7a9be","name":"GetTaskByID success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjM0OjE3Ljg4NjUzMzkrMDM6MDAiLCJpc19hZG1pbiI6ZmFsc2UsInVzZXJuYW1lIjoiYmVrYSJ9._jCyU4eSEOkuBk8Z4FAL6tCCGyXTEP7TIiJsuoIqQEE","type":"text"}],"url":{"raw":"localhost:8080/tasks/:id","host":["localhost"],"port":"8080","path":["tasks",":id"],"variable":[{"key":"id","value":"a549a7d6-d94a-49b5-9d56-99574e1b652c"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 06:42:27 GMT"},{"key":"Content-Length","value":"177"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"a549a7d6-d94a-49b5-9d56-99574e1b652c\",\n    \"title\": \"Task 1\",\n    \"description\": \"First task\",\n    \"due_date\": \"2024-08-06T11:40:10.331Z\",\n    \"status\": \"Pending\"\n}"}],"_postman_id":"e04c66a3-bd97-40b3-bea5-171e2bff4131"},{"name":"UpdateTaskByID","event":[{"listen":"test","script":{"id":"d22a097a-4b42-4395-8a14-24ab13b9a6e1","exec":["pm.test(\"Response status code is 201\", function () {\r","    pm.expect(pm.response.code).to.equal(201);\r","});\r","\r","\r","pm.test(\"Response has the required fields - id, title, description, due_date, and status\", function () {\r","    const responseData = pm.response.json();\r","\r","    pm.expect(responseData).to.be.an('object');\r","    pm.expect(responseData).to.have.property('id');\r","    pm.expect(responseData).to.have.property('title');\r","    pm.expect(responseData).to.have.property('description');\r","    pm.expect(responseData).to.have.property('due_date');\r","    pm.expect(responseData).to.have.property('status');\r","});\r","\r","\r","pm.test(\"Content-Type header is application/json\", function () {\r","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\r","});\r","\r","\r","pm.test(\"Verify the presence of ETag header\", function () {\r","    pm.response.to.have.header(\"ETag\");\r","});\r","\r","\r","pm.test(\"Response time is within an acceptable range\", function () {\r","  pm.expect(pm.response.responseTime).to.be.below(300);\r","});\r",""],"type":"text/javascript","packages":{}}}],"id":"396fa245-6ee7-4b7b-ab8f-324ccd3ed766","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"BEARER eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDgyMjAsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.tm06z9vLf7xYtcIgHGt8yqDb8dUnCW6C8z7ZZXRM994","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"Title\": \"Task 1 Update updated\",\r\n    \"description\": \"First Task Updated\",\r\n    \"status\": \"completed\",\r\n    \"due_date\": \"2023-08-10T15:04:05Z\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/tasks/:id","description":"<p>This endpoint allows you to update a specific task identified by its ID. The request should be sent to <code>localhost:8080/tasks/:id</code> using the HTTP PUT method.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<p>The request body should be in raw format and include the following parameters:</p>\n<ul>\n<li><p><code>Title</code> (string): The updated title of the task.</p>\n</li>\n<li><p><code>description</code> (string): The updated description of the task.</p>\n</li>\n<li><p><code>status</code> (string): The updated status of the task.</p>\n</li>\n<li><p><code>due_date</code> (string): The updated due date of the task.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful execution, the endpoint returns a status code of 201 and a JSON object with the updated details of the task, including the following properties:</p>\n<ul>\n<li><p><code>id</code> (string): The ID of the task.</p>\n</li>\n<li><p><code>title</code> (string): The title of the task.</p>\n</li>\n<li><p><code>description</code> (string): The description of the task.</p>\n</li>\n<li><p><code>due_date</code> (string): The due date of the task.</p>\n</li>\n<li><p><code>status</code> (string): The status of the task.</p>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"\",\n    \"title\": \"\",\n    \"description\": \"\",\n    \"due_date\": \"\",\n    \"status\": \"\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["tasks",":id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"52a48710-833d-4bd9-b136-86656b0a648e","key":"id"}]}},"response":[{"id":"0044e93c-322a-44a7-8a04-94fd8953ae5c","name":"Unauthorized update by user","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjQ3OjA0LjgzNTA4MyswMzowMCIsImlzX2FkbWluIjpmYWxzZSwidXNlcm5hbWUiOiJiZWthIn0.GdNeWZA1oYeNR7SWctqdKP78odaoBAT5Ne6aWJi9N0E","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"Title\": \"Task 1 Updated\",\r\n    \"description\": \"First Task Updated\",\r\n    \"status\": \"In Progress\",\r\n    \"due_date\": \"2023-08-10T15:04:05Z\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"localhost:8080/tasks/:id","host":["localhost"],"port":"8080","path":["tasks",":id"],"variable":[{"key":"id","value":"9e484920-0871-49a3-9bcf-2b9a29e7ec09"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 06:47:18 GMT"},{"key":"Content-Length","value":"31"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized access\"\n}"},{"id":"b22a8dcb-7867-4120-99e1-8c14c40577ae","name":"UpdateTaskByID update by admin","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjQ4OjAwLjg5MzczNSswMzowMCIsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.C1xh2Kj1qNnkljVS6Bkew5StS2-_AYEedPnIJq_oowM","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"Title\": \"Task 1 Updated\",\r\n    \"description\": \"First Task Updated\",\r\n    \"status\": \"In Progress\",\r\n    \"due_date\": \"2023-08-10T15:04:05Z\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"localhost:8080/tasks/:id","host":["localhost"],"port":"8080","path":["tasks",":id"],"variable":[{"key":"id","value":"a549a7d6-d94a-49b5-9d56-99574e1b652c"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 06:48:48 GMT"},{"key":"Content-Length","value":"193"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"a549a7d6-d94a-49b5-9d56-99574e1b652c\",\n    \"title\": \"Task 1 Updated\",\n    \"description\": \"First Task Updated\",\n    \"due_date\": \"2023-08-10T15:04:05Z\",\n    \"status\": \"In Progress\"\n}"}],"_postman_id":"396fa245-6ee7-4b7b-ab8f-324ccd3ed766"},{"name":"DeleteTask","event":[{"listen":"test","script":{"id":"e04a36fb-a7c1-4bae-9027-1e7edc06436d","exec":["pm.test(\"Response status code is 202\", function () {\r","  pm.expect(pm.response.code).to.equal(202);\r","});\r","\r","\r","pm.test(\"Response has the required fields - id, title, description, due_date, and status\", function () {\r","    const responseData = pm.response.json();\r","    \r","    pm.expect(responseData).to.be.an('object');\r","    pm.expect(responseData).to.have.property('id');\r","    pm.expect(responseData).to.have.property('title');\r","    pm.expect(responseData).to.have.property('description');\r","    pm.expect(responseData).to.have.property('due_date');\r","    pm.expect(responseData).to.have.property('status');\r","});\r","\r","\r","pm.test(\"ID is a non-empty string\", function () {\r","    const responseData = pm.response.json();\r","    \r","    pm.expect(responseData).to.be.an('object');\r","    pm.expect(responseData.id).to.be.a('string').and.to.have.lengthOf.at.least(1, \"ID should be a non-empty string\");\r","});\r","\r","\r","pm.test(\"Due date is in a valid date format\", function () {\r","  const responseData = pm.response.json();\r","  \r","  pm.expect(responseData).to.be.an('object');\r","  pm.expect(responseData.due_date).to.match(/^\\d{4}-\\d{2}-\\d{2}$/);\r","});\r","\r","\r","pm.test(\"Response time is less than 300ms\", function () {\r","  pm.expect(pm.response.responseTime).to.be.below(300);\r","});\r",""],"type":"text/javascript","packages":{}}}],"id":"44b5d0b0-2b55-44f6-964f-f02def924fbe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDgyMjAsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.tm06z9vLf7xYtcIgHGt8yqDb8dUnCW6C8z7ZZXRM994","type":"text"}],"url":"localhost:8080/tasks/:id","description":"<h3 id=\"delete-task\">Delete Task</h3>\n<p>This endpoint is used to delete a specific task identified by its ID.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p>Method: DELETE</p>\n</li>\n<li><p>URL: <code>localhost:8080/tasks/:id</code></p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><p>Status: 202</p>\n</li>\n<li><p>Content Type: application/json</p>\n</li>\n<li><p>{ \"id\": \"\", \"title\": \"\", \"description\": \"\", \"due_date\": \"\", \"status\": \"\"}</p>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"\",\n  \"title\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"status\": \"\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["tasks",":id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"24fd47ad-9f04-4b9e-88c3-bfb34cc253bf","key":"id"}]}},"response":[{"id":"a70f1c5c-3fe7-47c9-adbc-1e5728c05a61","name":"DeleteTask","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"localhost:8080/tasks/:id","host":["localhost"],"port":"8080","path":["tasks",":id"],"variable":[{"key":"id","value":"2"}]}},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Tue, 06 Aug 2024 12:59:10 GMT"},{"key":"Content-Length","value":"156"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"2\",\n    \"title\": \"Task 2\",\n    \"description\": \"Second task\",\n    \"due_date\": \"2024-08-07T15:58:30.1273158+03:00\",\n    \"status\": \"In Progress\"\n}"}],"_postman_id":"44b5d0b0-2b55-44f6-964f-f02def924fbe"},{"name":"AddTask","event":[{"listen":"test","script":{"id":"f74ddc45-412f-4bbb-b48f-5db9e7b6614f","exec":["pm.test(\"Response status code is 201\", function () {\r","  pm.response.to.have.status(201);\r","});\r","\r","\r","pm.test(\"Response time is less than 200ms\", function () {\r","  pm.expect(pm.response.responseTime).to.be.below(200);\r","});\r","\r","\r","pm.test(\"Response has the required fields - id, title, description, due_date, and status\", function () {\r","    const responseData = pm.response.json();\r","    \r","    pm.expect(responseData).to.be.an('object');\r","    pm.expect(responseData).to.have.property('id');\r","    pm.expect(responseData).to.have.property('title');\r","    pm.expect(responseData).to.have.property('description');\r","    pm.expect(responseData).to.have.property('due_date');\r","    pm.expect(responseData).to.have.property('status');\r","});\r","\r","\r","pm.test(\"Id is a non-empty string\", function () {\r","  const responseData = pm.response.json();\r","  \r","  pm.expect(responseData).to.be.an('object');\r","  pm.expect(responseData.id).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Id should not be empty\");\r","});\r","\r","\r","pm.test(\"Due date is in a valid date format\", function () {\r","  const responseData = pm.response.json();\r","  \r","  pm.expect(responseData.due_date).to.match(/^\\d{4}-\\d{2}-\\d{2}$/);\r","});\r",""],"type":"text/javascript","packages":{}}}],"id":"ed4a33a4-962b-435c-b0e3-4b03ae148c89","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDgyMjAsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.tm06z9vLf7xYtcIgHGt8yqDb8dUnCW6C8z7ZZXRM994","type":"text"}],"body":{"mode":"raw","raw":"{\r\n        \"title\": \"Task 3\",\r\n        \"description\": \"Second task\",\r\n        \"due_date\": \"2024-08-06T14:40:10.331133+03:00\",\r\n        \"status\": \"Pending\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"localhost:8080/tasks","description":"<h3 id=\"post-tasks\">POST /tasks</h3>\n<p>This endpoint is used to create a new task.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>title</code> (string, required): The title of the task.</p>\n</li>\n<li><p><code>description</code> (string, required): The description of the task.</p>\n</li>\n<li><p><code>due_date</code> (string, required): The due date of the task.</p>\n</li>\n<li><p><code>status</code> (string, required): The status of the task.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response is in JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": {\n    \"type\": \"string\"\n  },\n  \"title\": {\n    \"type\": \"string\"\n  },\n  \"description\": {\n    \"type\": \"string\"\n  },\n  \"due_date\": {\n    \"type\": \"string\"\n  },\n  \"status\": {\n    \"type\": \"string\"\n  }\n}\n\n</code></pre>\n<p>Example response:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"\",\n  \"title\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"status\": \"\"\n}\n\n</code></pre>\n<h4 id=\"request-body-example\">Request Body Example</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"title\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"status\": \"\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"eeeca695-8c03-42d0-b2dc-17a9a18be161","name":"AddTask","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjQ4OjAwLjg5MzczNSswMzowMCIsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.C1xh2Kj1qNnkljVS6Bkew5StS2-_AYEedPnIJq_oowM","type":"text"}],"body":{"mode":"raw","raw":"{\r\n        \"title\": \"Task 2\",\r\n        \"description\": \"Second task\",\r\n        \"due_date\": \"2024-08-06T14:40:10.331133+03:00\",\r\n        \"status\": \"Pending\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"localhost:8080/tasks"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Location","value":"http://localhost:8080/tasks/00000000-0000-0000-0000-000000000000"},{"key":"Date","value":"Fri, 09 Aug 2024 09:57:48 GMT"},{"key":"Content-Length","value":"186"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"87b14605-d400-4549-9be7-ac16883a5d36\",\n    \"title\": \"Task 2\",\n    \"description\": \"Second task\",\n    \"due_date\": \"2024-08-06T14:40:10.331133+03:00\",\n    \"status\": \"Pending\"\n}"}],"_postman_id":"ed4a33a4-962b-435c-b0e3-4b03ae148c89"},{"name":"RegisterUser","id":"08868ec7-c83f-451c-851e-f4db0a745ca0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"beka\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/register","description":"<h3 id=\"register-user\">Register User</h3>\n<p>This endpoint allows the client to register a new user.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>username</code> (string, required): The username of the user.</p>\n</li>\n<li><p><code>password</code> (string, required): The password for the user account.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response will be in the JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"type\": \"object\",\n    \"properties\": {\n        \"id\": {\n            \"type\": \"string\"\n        },\n        \"username\": {\n            \"type\": \"string\"\n        },\n        \"password\": {\n            \"type\": \"string\"\n        },\n        \"is_admin\": {\n            \"type\": \"boolean\"\n        }\n    }\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["register"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"3059a940-183c-40a4-9423-4c76b2c0bbdd","name":"FirstTimeRegister","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"abe16s\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:51:08 GMT"},{"key":"Content-Length","value":"180"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"ea3e3e73-57ad-4c3c-aff9-6dfdf7d4e78e\",\n    \"username\": \"abe16s\",\n    \"password\": \"$2a$10$n3watE2dZ7WPz4oZA.3yIOXKPrBG5GUrOt8gg5WmpI3EpTg.NhLH.\",\n    \"is_admin\": true\n}"},{"id":"839b1c90-2a67-4987-b98e-05dd3fc7e6cd","name":"UserRegister","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"mysteryabe\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:51:39 GMT"},{"key":"Content-Length","value":"185"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"dbb4214c-9350-439d-8076-d5991944008f\",\n    \"username\": \"mysteryabe\",\n    \"password\": \"$2a$10$IGBND9JiH.vLRHJPl9J/8Oema2uD2.z6/wd6zr8hMwz9ycFMZc6ki\",\n    \"is_admin\": false\n}"},{"id":"ef1f5c25-3bef-472d-b2f8-08265a751026","name":"UsernameConflict","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"mysteryabe\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/register"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:54:12 GMT"},{"key":"Content-Length","value":"42"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"username already exists\"\n}"}],"_postman_id":"08868ec7-c83f-451c-851e-f4db0a745ca0"},{"name":"LoginUser","id":"73014669-47bf-47aa-b2c6-7d03e3896af7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"abe16s\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/login","description":"<h3 id=\"post-login\">POST /login</h3>\n<p>This endpoint is used to authenticate a user and obtain a token for accessing protected resources.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>username</code> (string, required): The username of the user.</p>\n</li>\n<li><p><code>password</code> (string, required): The password of the user.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response is in JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"token\": {\n      \"type\": \"string\"\n    }\n  }\n}\n\n</code></pre>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Sample message\",\n  \"token\": \"sampleTokenValue\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4171fbf4-bd26-4fc6-b2ed-358a1b561c31","name":"SuccessfulLogin","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"mysteryabe\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:58:49 GMT"},{"key":"Content-Length","value":"258"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User logged in successfully\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA4OjU4OjQ5LjY3OTkwNjUrMDM6MDAiLCJpc19hZG1pbiI6ZmFsc2UsInVzZXJuYW1lIjoibXlzdGVyeWFiZSJ9.lyled7RNu3IS54MtoDra3rzZl-P2nBFHjPd8bpoUA3c\"\n}"},{"id":"7e3f9e9c-c403-4944-950a-4130383e69fb","name":"UserNotFound","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"mysteryab\",\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/login"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:59:14 GMT"},{"key":"Content-Length","value":"33"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"user not found\"\n}"},{"id":"2ba43c34-8e3c-4602-89f1-4742648f7102","name":"InvalidCredentials","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"mysteryabe\",\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 05:59:32 GMT"},{"key":"Content-Length","value":"38"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"invalid credentials\"\n}"}],"_postman_id":"73014669-47bf-47aa-b2c6-7d03e3896af7"},{"name":"PromoteUser","id":"ae667ddb-f5c5-4227-9561-1d8c0e302df3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjM1NDgyMjAsImlzX2FkbWluIjp0cnVlLCJ1c2VybmFtZSI6ImFiZTE2cyJ9.tm06z9vLf7xYtcIgHGt8yqDb8dUnCW6C8z7ZZXRM994","type":"text"}],"url":"localhost:8080/promote?username=beka","description":"<h3 id=\"patch-user-promotion\">Patch User Promotion</h3>\n<p>This endpoint is used to promote a user by sending an HTTP PATCH request to the specified URL with the username as a query parameter.</p>\n<h4 id=\"request-parameters\">Request Parameters</h4>\n<ul>\n<li><code>username</code> (query parameter): The username of the user to be promoted.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>Upon successful execution, the server will respond with a status code of 200 and a JSON object with a <code>message</code> key indicating the result of the promotion.</p>\n<h5 id=\"example-response\">Example Response</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"\"\n}\n\n</code></pre>\n","urlObject":{"port":"8080","path":["promote"],"host":["localhost"],"query":[{"key":"username","value":"beka"}],"variable":[]}},"response":[{"id":"86e88983-737c-466d-ada1-c50b648d93cc","name":"PromoteUser","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjAyOjEwLjUwNTkzMzMrMDM6MDAiLCJpc19hZG1pbiI6dHJ1ZSwidXNlcm5hbWUiOiJhYmUxNnMifQ._GfgSf0fptP4s8eDczSCtdPql4uok4IEvqITw1kOO8g","type":"text"}],"url":{"raw":"localhost:8080/promote?username=mysteryabe","host":["localhost"],"port":"8080","path":["promote"],"query":[{"key":"username","value":"mysteryabe"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 06:05:00 GMT"},{"key":"Content-Length","value":"56"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User promoted to admin successfully\"\n}"},{"id":"39797dbc-c02b-4e8e-a9e1-d160e370cccc","name":"Unauthorized","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOiIyMDI0LTA4LTA5VDA5OjA2OjE2Ljg0NDgxMDUrMDM6MDAiLCJpc19hZG1pbiI6ZmFsc2UsInVzZXJuYW1lIjoiZXBocmVtIn0.JVLxQiQTGJNHEuSrFs6bC4UnOwIC5QwzqgcsT6wIZg4","type":"text"}],"url":{"raw":"localhost:8080/promote?username=mysteryabe","host":["localhost"],"port":"8080","path":["promote"],"query":[{"key":"username","value":"mysteryabe"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Fri, 09 Aug 2024 06:06:32 GMT"},{"key":"Content-Length","value":"31"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized access\"\n}"}],"_postman_id":"ae667ddb-f5c5-4227-9561-1d8c0e302df3"}]}