Back to Browse

TestContainer From Zero to One. TestContainer Spring Boot, MySQL and RabbitMQ example.

2.3K views
Jun 3, 2022
1:22:46

TestContainer Spring Boot, MySQL, RabbitMQ, Maven, and Gradle example. REST API integration testing end to end. TestContainer + Spring Boot + MySQL DB+ RAbbitMQ Why TestContainer? 00:00:20 How to do integration testing for container apps? TestContainer using docker API -Introduction Prerequisites -Docker -JDK -maven or Gradle build tool -Support JVM-based test frameworks such as Junit 4/5, Spock, etc. - Features 00:06:05 - Create Spring Boot Project 00:08:44 - Setup container in local for MySQL DB and RabbitMQ 00:14:18 - Sample Example with spring boot with Junit 00:23:00 - Play with Testcontainer 00:29:20 - TestContainer Best Practices 01:12:10 - Use the singleton pattern, use the static block - Speed up start time with multiple containers - Reuse the container - Run test in docker container (Docker in Docker) Configuration Property to update to reuse the container 00:53:10 Linux: /home/myuser/.testcontainers.properties. Windows: C:/Users/myuser/.testcontainers.properties. macOS: /Users/myuser/.testcontainers.properties. Create Generic Container using Testcontainer 01:02:00 Spring set properties dynamically 01:06:40 Get Data or Properties from Container using TestContainer 01:07:23 Create a container on the fly using DockerFile 01:15:18 In situations where there is no pre-existing Docker image, Testcontainers can create a new temporary image on the fly from a Dockerfile 1. with Docker File, you can create Container 2. Without Having a docker file, on the fly create a container. If you don't have static Dockerfile then use the below code GithubSource Code:- https://github.com/maheshwarLigade/TestContainerDemo Docker Course For the beginner: https://youtu.be/5LKLGrzVwXo For more such Tutorials http://techwasti.com/ Medium Publication https://medium.com/techwasti/ Reference:- https://www.testcontainers.org/

Download

0 formats

No download links available.

TestContainer From Zero to One. TestContainer Spring Boot, MySQL and RabbitMQ example. | NatokHD