/spring-boot-microservices

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.

Primary LanguageJavaMIT LicenseMIT

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.

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 installed on your machine.

Steps to Install Java 8

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

Note: Subscribe to watch technological videos on different trending technologies