Giter Site home page Giter Site logo

inthirties / springbootnumbergeneratorapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mraotech/springbootnumbergeneratorapp

0.0 0.0 0.0 25 KB

Spring boot application that generates a sequence of numbers in the decreasing order till 0.

Java 100.00%

springbootnumbergeneratorapp's Introduction

SpringBootNumberGeneratorApp

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:

  1. POST /api/bulkGenerate
  2. POST /api/generate
  3. GET /api/tasks/{UUID of the task}?action=get_numlist
  4. GET /api/tasks/{UUID of the task}/status

Along with this, project supports the following:

  1. Validation of Requests.
  2. JUNIT Tests with report generation capabilities.
  3. Configurable Threading options.
  4. Swagger Documentation and UI.

Usage and Swagger

  1. Checkout code, go to the main project directory and build using the following command:
mvn clean install -Dmaven.test.skip=true
  1. Once build is successful, the Spring boot app can be run using the following command:
java -jar target\numbergenerator-0.0.1-SNAPSHOT.jar
  1. Once the Embedded Tomcat and the application starts, the swagger UI can be accessed here:
http://localhost:8080/swagger-ui/index.html#/
  1. APIs also will be accessible.

Running Tests

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:

  1. GET Status with a wrong UUID
  2. GET Result with a wrong UUID
  3. POST generate with missing step input
  4. POST generate where goal input is renamed
  5. POST generate with a string value for step
  6. POST generate with a negative value for goal
  7. POST generate with step value > goal
  8. POST generate with values Goal 10 and Step 2
  9. GET Status with UUID returned from #9. Expect IN_PROGRESS first and then wait till SUCCESS
  10. GET Result with UUID and Request Param. Match the data obtained
  11. POST generate with values Goal 8 and Step 8
  12. GET Status with UUID returned from #12 in loop. Expect IN_PROGRESS first and then SUCCESS
  13. GET Result with UUID and Request Param. Match the data obtained
  14. POST generate bulk (two) with one missing step input
  15. POST generate bulk (three) with two negative values for goal
  16. POST generate bulk (two) with one value step > goal
  17. POST generate bulk (single) with one value step > goal
  18. POST generate bulk (three) with values Goal 10 and Step 3, Goal 8 and Step 7, Goal 9 and Step 5
  19. GET Status with UUID returned from #19. Expect IN_PROGRESS first and then wait till SUCCESS
  20. GET Result with UUID and Request Param. Match the data obtained

Contributing

NONE

License

NONE

springbootnumbergeneratorapp's People

Contributors

mraotech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.