Spring boot application that generates a sequence of numbers in the decreasing order till 0. Simulate that the function to generate a number takes a random time โ say between 10 to 30 seconds. Inputs: step, goal. The following APIs are supported:
- POST /api/bulkGenerate
- POST /api/generate
- GET /api/tasks/{UUID of the task}?action=get_numlist
- GET /api/tasks/{UUID of the task}/status
Along with this, project supports the following:
- Validation of Requests.
- JUNIT Tests with report generation capabilities.
- Configurable Threading options.
- Swagger Documentation and UI.
- Checkout code, go to the main project directory and build using the following command:
mvn clean install -Dmaven.test.skip=true
- Once build is successful, the Spring boot app can be run using the following command:
java -jar target\numbergenerator-0.0.1-SNAPSHOT.jar
- Once the Embedded Tomcat and the application starts, the swagger UI can be accessed here:
http://localhost:8080/swagger-ui/index.html#/
- APIs also will be accessible.
To run JUNIT tests, under the main project directory, run the following command. This will generate reports under \target\surefire-reports
mvn surefire-report:report
Following test Cases are covered both manually as well as part of unit tests:
- GET Status with a wrong UUID
- GET Result with a wrong UUID
- POST generate with missing step input
- POST generate where goal input is renamed
- POST generate with a string value for step
- POST generate with a negative value for goal
- POST generate with step value > goal
- POST generate with values Goal 10 and Step 2
- GET Status with UUID returned from #9. Expect IN_PROGRESS first and then wait till SUCCESS
- GET Result with UUID and Request Param. Match the data obtained
- POST generate with values Goal 8 and Step 8
- GET Status with UUID returned from #12 in loop. Expect IN_PROGRESS first and then SUCCESS
- GET Result with UUID and Request Param. Match the data obtained
- POST generate bulk (two) with one missing step input
- POST generate bulk (three) with two negative values for goal
- POST generate bulk (two) with one value step > goal
- POST generate bulk (single) with one value step > goal
- POST generate bulk (three) with values Goal 10 and Step 3, Goal 8 and Step 7, Goal 9 and Step 5
- GET Status with UUID returned from #19. Expect IN_PROGRESS first and then wait till SUCCESS
- GET Result with UUID and Request Param. Match the data obtained
NONE
NONE