Code Monkey home page Code Monkey logo

books-api's Introduction

Demo APIs - to demonstrate Unit Tests, Integration Tests, and Web Integration Tests.

Idea is to cover all the tests at lower level of Test Pyramid which will help for Continuous Integration.

Unit tests

  • Unit tests for Service uses h2 in memory database
  • Unit tests for Controller uses Mockito

Integration tests

  • Integrations tests are written with MockMvc and TestRestTemplate

To run the unit tests, integration tests

mvn clean install

Below both commands would run the application with in memory h2 database

mvn spring-boot:run

mvn spring-boot:run -Dspring-boot.run.profiles=dev

To run the application with mysql database

mvn spring-boot:run -Dspring-boot.run.profiles=test

Note: Need to setup mysql server locally with details as mentioned in 'application-test.properties'. This can be used for E2E tests written with Rest-assured in repository https://github.com/dhaneshkhot/books-api-rest-assured.

API Endpoint when ran locally:
http://localhost:8080/api/books/

books-api's People

Contributors

dhaneshkhot avatar

Watchers

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