GithubHelp home page GithubHelp logo

ausmanki / springboot-testcontainers-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hendisantika/springboot-testcontainers-demo

0.0 0.0 0.0 95 KB

Spring Boot Test Containers Demo

Java 100.00%

springboot-testcontainers-demo's Introduction

springboot-testcontainers-demo

Tools and technologies used

  1. Java 11+
  2. Spring Boot
  3. Spring Data JPA
  4. MySQL
  5. Lombok
  6. JUnit 5 Framework
  7. IntelliJ IDEA
  8. Testcontainers
  9. Docker
  10. Maven

What is Integration Testing

As the name suggests, integration tests focus on integrating different layers of the application. That also means no mocking is involved.

Basically, we write integration tests for testing a feature that may involve interaction with multiple components.

Examples: Integration testing of complete Employee Management Feature ( EmployeeRepository, EmployeeService, EmployeeController).

Integration testing of complete User Management Feature (UserController, UserService, and UserRepository).

Integration testing of complete Login Feature (LoginRespository, LoginController, Login Service), etc

What is Testcontainers?

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Using Testcontainers is fairly easy and it gives us the opportunity to create integration tests without the need for pre-installed components.

Using Testcontainers, we would always start with a clean database and our integration tests could run on any machine.

Testcontainer allows us to use Docker containers within our tests. As a result, we can write self-contained integration tests that depend on external resources.

Things todo list:

  1. Clone this repository: git clone https://github.com/hendisantika/springboot-testcontainers-demo.git
  2. Navigate to the folder: cd springboot-testcontainers-demo
  3. Run the integration test: mvn clean test

springboot-testcontainers-demo's People

Contributors

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