299 lines
7.8 KiB
JSON
299 lines
7.8 KiB
JSON
{
|
|
"info": {
|
|
"name": "Course Registration API",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
|
"description": "Seed dataset 기반 수강신청 API 검증 컬렉션. k6 부하 테스트는 별도 후속 범위입니다."
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "Lessons",
|
|
"item": [
|
|
{
|
|
"name": "List lessons",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/lessons?semesterId={{semesterId}}&page=0&size=20",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Get lesson",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/lessons/{{lessonId}}",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Registrations",
|
|
"item": [
|
|
{
|
|
"name": "Register lesson",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{lessonId}}\"}"
|
|
}
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"pm.test('201 Created', () => pm.response.to.have.status(201));",
|
|
"const body = pm.response.json();",
|
|
"pm.environment.set('registrationId', body.registrationId);"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "My registrations",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations?semesterId={{semesterId}}",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Cancel registration",
|
|
"request": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations/{{registrationId}}",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
}
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"exec": [
|
|
"pm.test('204 No Content', () => pm.response.to.have.status(204));"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Error Scenarios",
|
|
"item": [
|
|
{
|
|
"name": "Grade restriction",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{minGradeLessonId}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Role restriction",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{postgraduateOnlyLessonId}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Capacity first seat",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{studentId}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{capacityOneLessonId}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Capacity exceeded",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{student2Id}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{capacityOneLessonId}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Duplicate registration first",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{student2Id}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{dataStructures01Id}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Duplicate registration again",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{student2Id}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{dataStructures01Id}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Duplicate subject other section",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{student2Id}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{dataStructures02Id}}\"}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Schedule conflict",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{baseUrl}}/api/v1/users/{{student2Id}}/registrations",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
]
|
|
},
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\"lessonId\": \"{{overlapLessonId}}\"}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|