-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.http
More file actions
115 lines (89 loc) · 2.06 KB
/
api.http
File metadata and controls
115 lines (89 loc) · 2.06 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
@baseUrl = http://localhost:8080
@contentType = application/json
### Health Check
GET {{baseUrl}}/health
Accept: {{contentType}}
### Create Todos with Different Priorities
### High Priority Todo
POST {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"task": "Complete project documentation",
"priority": "high",
"due_date": "2024-12-31T23:59:59Z"
}
### Medium Priority Todo
POST {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"task": "Review code changes",
"priority": "medium",
"due_date": "2024-12-20T23:59:59Z"
}
### Low Priority Todo
POST {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"task": "Update dependencies",
"priority": "low"
}
### Get All Todos
GET {{baseUrl}}/todo
Accept: {{contentType}}
### Get Todos by Priority
GET {{baseUrl}}/todo/priority/high
Accept: {{contentType}}
### Get Todos by Status
GET {{baseUrl}}/todo/status/TO_BE_STARTED
Accept: {{contentType}}
### Search Todos
GET {{baseUrl}}/search?q=project
Accept: {{contentType}}
### Update Todo Status to IN_PROGRESS
PUT {{baseUrl}}/todo/status
Content-Type: {{contentType}}
{
"item": "Complete project documentation",
"status": "IN_PROGRESS"
}
### Update Todo Status to COMPLETED
PUT {{baseUrl}}/todo/status
Content-Type: {{contentType}}
{
"item": "Complete project documentation",
"status": "COMPLETED"
}
### Delete Todo
DELETE {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"item": "Update dependencies"
}
### Error Cases ###
### Try to create todo with invalid priority
POST {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"task": "Test invalid priority",
"priority": "INVALID"
}
### Try to update with invalid status
PUT {{baseUrl}}/todo/status
Content-Type: {{contentType}}
{
"item": "Complete project documentation",
"status": "INVALID_STATUS"
}
### Try to create duplicate todo
POST {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"task": "Complete project documentation",
"priority": "high"
}
### Try to delete non-existent todo
DELETE {{baseUrl}}/todo
Content-Type: {{contentType}}
{
"item": "Non existent task"
}