# | Name | Description |
---|---|---|
1 | tropicalflix | The movie system |
2 | financial-service | The fake payment system |
# | Tech | Version |
---|---|---|
1 | Java | 21 |
2 | Spring Boot | 3.2.5 |
3 | MySQL | 8.3.0 |
4 | JUnit | 5.10.2 |
5 | Gatling | 3.11.2 |
6 | JaCoCo | 0.8.12 |
7 | H2 | 2.2.224 |
8 | Testcontainers | 1.19.8 |
To demonstrate how to use the libraries to test a Spring Boot application.
- List of movies, genres, and actors
- Edit of genres and actors
- Fake subscription
- Clone the project and change to project directory
git clone https://github.com/luizgustavocosta/java-spring-boot-tests.git cd java-spring-boot-tests
- Start the financial-service. This service runs on port 8081
cd financial-service && mvn spring-boot:run
- Start the Tropicalflix service using the in-memory database *. This service runs on port 8080
cd tropicalflix && mvn spring-boot:run -Dspring-boot.run.profiles=h2
- You can choose 3 profiles.
- h2 (in-memory database)
- mysql (create a new MySQL database and add data)
- mysql-image (Use a MySQL image that contains data)
mvn spring-boot:run
mvn spring-boot:run -Dspring-boot.run.profiles=h2
mvn spring-boot:run -Dspring-boot.run.profiles=h2
mvn jacoco:report
mvn gatling:test
mvn failsafe:integration-test
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=Tropicalflix -e MYSQL_USER=root -e MYSQL_PASSWORD=password --name=mysql mysql/mysql-server:8.0.32
docker run -p 8080:8080 -e SPRING_PROFILES_ACTIVE=h2 16bits/tropicalflix:0.0.1
docker run -p 8080:8080 -e SPRING_PROFILES_ACTIVE=mysql-image 16bits/tropicalflix:0.0.1
docker build -t 16bits/tropicalflix:0.0.1 . docker run -p 8080:8080 -e SPRING_PROFILES_ACTIVE=h2 16bits/tropicalflix:0.0.1
docker build -t 16bits/tropicalflix_db:0.0.1 . docker run -d -p 3306:3306 --name tropicalflixDB -e MYSQL_USER=root -e MYSQL_ROOT_PASSWORD=password tropicalflix_db:0.0.1
docker push 16bits/financial-service:0.0.1 docker push 16bits/tropicalflix:0.0.1 docker build 16bits/tropicalflix_db:0.0.1
k6 run --out json=test.json load_test.js