Springboot application facing bellow error or need to implement real test data base:
Senario:
Could not prepare statement [Table “XXXX” not found (this database is empty); SQL statement
Solution:
Add bellow configuration in test application.yml
spring:
test:
database:
replace: none
---
Code:
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:mariadb")
Test containers:
References:
test container examples here