The purpose of spring-boot-microservices project is to learn how to build a microservice using Spring Boot Framework. spring-boot-microservices project contains api & endpoint-tests sub projects.The api project contains the implementation of Account REST API using Spring Boot.As part of implementation CRUD operation is implemented and H2 database is integrated using JPA also unit tests are implemented using junit, mockito & jacoco frameworks.The endpoint-tests project contains the integration test implemented using Rest-Assured.
- API
- H2 Database Integration using JPA
- Unit Tests
- Endpoint Tests
- Dockerfile
Clone spring-boot-microservices and open api & endpoint-tests with Spring Tool Suite you can use any other IDE as well.
To run Spring Boot based Account REST API it is prerequisite to have Java 8 & Docker installed on your machine.
Pull requests are welcome. I will appreciate any help on improving/enhancing the project.
- Sagar Jadhav - sagar-jadhav
- Controller
- Service
- Repository
- Model
- Controller Unit Test
- Service Unit Test
- Account Endpoint Test
- Postman Collection
- API Dockerfile
- Go to api directory. for e.g. cd <PATH_TO_CLONED_DIRECTORY>/api
- Run ./gradlew clean build
- Run java -jar ./build/libs/api-1.0.0.jar
- Go to api directory. for e.g. cd <PATH_TO_CLONED_DIRECTORY>/api
- Run ./gradlew clean build test
- Open file://<PATH_TO_CLONED_DIRECTORY>/api/build/reports/jacoco/test/html/index.html in any browser to view the coverage report
- Go to endpoint-tests directory. for e.g. cd <PATH_TO_CLONED_DIRECTORY>/endpoint-tests
- Run ./gradlew clean build test
- Open file://<PATH_TO_CLONED_DIRECTORY>/endpoint-tests/build/reports/tests/test/index.html in any browser to view the test report
- Go to cloned directory. for e.g. cd <PATH_TO_CLONED_DIRECTORY>/
- Run docker build -t [NAME OF IMAGE]:[TAG] -f api_dockerfile . for e.g. docker build -t spring_boot_microservice:v1 -f api_dockerfile .
- Verify by running command docker images. After running this command you will see newly created image listed here.
- Run docker run -p 8080:8080 [NAME OF IMAGE]:[TAG] for e.g. docker run -p 8080:8080 spring_boot_microservice:v1
Note: Subscribe to watch technological videos on different trending technologies