Question: 1) Create a Multi-Module REST API service using Spring Boot - API module - exposes API (support CRUD operation) - Must validate input parameters -
1) Create a Multi-Module REST API service using Spring Boot
- API module - exposes API (support CRUD operation)
- Must validate input parameters
- Catch exception scenarios
- http 200 for successful response
- http 400 for bad requests
- etc..
- Service Module
- Should handle all the business logic
- API module only talks to Service module.
- DTO module
- Object model represents input and output parameters in the API module, these objects are created or read in the business layer, this object should not be passed to the Repository layer.
- Repository module - This module talks to the Database, use MongoDB for this.
- Use a different Model object to represent DB Collection. For most part DTO and repository model objects may look similar but we want to keep it separate, for example repository model may have 25 attributes/fields but the API may only require 5 attributes/fields. Transformation of this model happens in the business module.
- Utils module - This module is used for any common utilities.
1> Write JUNIT tests for each module and classes, use Mockito or Powermock to make the object in the downstream modules.
2> Check-in your code into the git repository of your choice.
3> Embed Swagger to publish API endpoints.
4> API should be testable via Swagger-UI
5> Use Lombok for Getter/Setter annotation.
6> You can take upto 4 days to complete the above tasks but the candidate who submits the work earlier has a better chance, but quality of the code is very important.
7> Use Java 11 and Maven for dependency management.
8> Use Intellij IDE community edition or higher for development.
9> Include a README file on how to run the code, ideally a maven command should build and deploy on an embedded tomcat container, it is preferred that if you can include a single script file which can call the necessary commands to build and deploy the application.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
