The test suite (TodoControllerTest) should run after your implementation (see badge below). You are not allowed to change the test class!
Check the tab Actions in GitHub for more information and to activate the workflow run.
- The test class sends POST-Request to create TODOs without IDs and expects the single created TODO to return with an ID! See REST API examples PUT and POST below.
- Furthermore, if a Todo with a given id should be retrieved, updated, or deleted and it does not exist, the tests expect a specific error message. See GET, PUT, and DELETE.
[
{
"id": 1,
"summary": "Buy food",
"description": "Buy an egg and ramen"
},
{
"id": 2,
"summary": "Walk the dog",
"description": "Walk the dog for 30 minutes"
},
{
"id": 3,
"summary": "Train",
"description": "Train weight lifting for five hours"
}
]
{
"id": 1,
"summary": "Buy food",
"description": "Buy an egg and ramen"
}
If the Todo with the id 999 does not exist.
{
"timestamp": "2023-10-06T11:52:27.842+00:00",
"status": 404,
"error": "Not Found",
"message": "Todo with the id 999 not found!",
"path": "/todos/999"
}
Body:
{
"summary": "Buy food",
"description": "Buy an egg and ramen"
}
Response:
{
"id": 1,
"summary": "Buy food",
"description": "Buy an egg and ramen"
}
Body:
{
"summary": "Buy copious amounts of food",
"description": "Buy two eggs and ramen"
}
Response:
{
"id": 1,
"summary": "Buy copious amounts of food",
"description": "Buy two eggs and ramen"
}
If the Todo with the id 999 does not exist.
Body:
{
"summary": "Buy copious amounts of food",
"description": "Buy two eggs and ramen"
}
Response:
{
"timestamp": "2023-10-06T11:54:55.392+00:00",
"status": 404,
"error": "Not Found",
"message": "Todo with the id 999 not found!",
"path": "/todos/999"
}
[
{
"id": 2,
"summary": "Walk the dog",
"description": "Walk the dog for 30 minutes"
},
{
"id": 3,
"summary": "Train",
"description": "Train weight lifting for five hours"
}
]
If the Todo with the id 999 does not exist.
{
"timestamp": "2023-10-06T11:56:29.114+00:00",
"status": 404,
"error": "Not Found",
"message": "Todo with the id 999 not found!",
"path": "/todos/999"
}