Create a simple Spring Boot application that provides RESTful endpoints for the following mappings:
GET /api/{entity}- Retrieve all entities
- should return
200with a list (can be empty)
GET /api/{entity}/{id}- Retrieve a specific entity by ID
- should return
200with the entity if found or404if not found
POST /api/{entity}- Create a new entity
- should return
201or400on invalid RequestBody
PUT /api/{entity}/{id}- Update an existing entity by ID
- should return
200if found,400on invalid RequestBody or404if not found
DELETE /api/{entity}/{id}- Delete an entity by ID
- should return
204if deleted, or404if not found
Names can vary on your preferred naming conventions. But the endpoints should performe the described operations.
-
One of the endpoints should also include custom business logic that exceeds the default CRUD operation. Doesn't have to be complex, just enough to show that custom logic is implemented. (e.g., a logging statement, validation, transformation, etc.)
-
Another endpoint should be a completely custom endpoint that performs none of the above operations. The logic doesn't have to be complex, just enough to show that a custom implementation is used.
-
Each read endpoint (GET endpoints) should be secured with MethodLevel Security using
@PreAuthorize(”hasRole(USER)”)and each write endpoint (POST, PUT and DELETE endpoints) should be secured with role ADMIN. You don't need to implement a full authentication mechanism. The two required roles are already provided in the security configuration. -
CURL requests will be provided for each of the basic endpoints. You can use them to test your implementation.
DO NOT UPDATE THE MAIN BRANCH DIRECTLY!
The main branch contains the initial setup of the Spring Boot application with the necessary dependencies and configurations.
Create a new branch from main for each task:
{UserID}/baseline- Implementation of the Endpoints with default SpringBoot.{UserID}/sprout- Implementation of the Endpoints using Sprout.
Please track the time you need for each branch separately. You'll need the tracked time later in the survey.
Don't pressure yourself to be the fastest. The intention is to see the difference in time needed for both implementations. Not to see who is the fastest.