Skip to content

spring-boot-microservices project contains implementation of Account REST API using Spring Boot Framework along with unit test implementation using Junit, Mockito & Jacoco and Endpoint Tests implementation using Rest-Assured Framework.

License

Notifications You must be signed in to change notification settings

sagar-jadhav/spring-boot-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-microservices

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.

Project Highlights

  • API
  • H2 Database Integration using JPA
  • Unit Tests
  • Endpoint Tests
  • Dockerfile

Getting Started

Clone spring-boot-microservices and open api & endpoint-tests with Spring Tool Suite you can use any other IDE as well.

Prerequisites

To run Spring Boot based Account REST API it is prerequisite to have Java 8 & Docker installed on your machine.

Contributing

Pull requests are welcome. I will appreciate any help on improving/enhancing the project.

Authors

Content

Youtube Tutorials

Steps to Run Spring Boot based Account REST API

  • 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

Steps to Run Unit Test & Generate Jacoco Test Coverage Report

  • 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

Steps to Run Endpoint Tests

  • 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

Steps to Build Docker Image

  • 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.

Steps to Run Docker Image

  • 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

About

spring-boot-microservices project contains implementation of Account REST API using Spring Boot Framework along with unit test implementation using Junit, Mockito & Jacoco and Endpoint Tests implementation using Rest-Assured Framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages