Unfortunately not, but the presented technique also applies to any other RDBMS. For MySQL, you can use the MySQL Testcontainers module: www.testcontainers.org/modules/databases/mysql/
1:08 Why don't I have this error and the test passes correctly? I have these settings: spring.datasource.driver-class-name=org.postgresql.Driver spring.datasource.url=jdbc:postgresql://localhost:5432/database1 spring.datasource.username=postgres spring.datasource.password=postgres
Hm not sure what's going wrong on your side there. I'm using the Testcontainers BOM in multiple projects and it works fine for me, e.g. see here github.com/rieckpil/testing-spring-boot-applications-masterclass/blob/master/pom.xml You can also work without the BOM but then have to bump all version definitions if there's a new Testcontainers release.
Thank you
Have you a tutorial with MySQL connection?
Unfortunately not, but the presented technique also applies to any other RDBMS. For MySQL, you can use the MySQL Testcontainers module: www.testcontainers.org/modules/databases/mysql/
about the image: is "postgres:12" an existing image?
Yes, it's the official PostgreSQL image hub.docker.com/_/postgres
@@rieckpil thanks
1:08 Why don't I have this error and the test passes correctly? I have these settings:
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/database1
spring.datasource.username=postgres
spring.datasource.password=postgres
it seems that BOM doesn't really work; @Testcontainers is not recognized. I used the following both, then it becomes fine
org.testcontainers
postgresql
1.15.3
test
org.testcontainers
junit-jupiter
1.15.3
test
Hm not sure what's going wrong on your side there. I'm using the Testcontainers BOM in multiple projects and it works fine for me, e.g. see here github.com/rieckpil/testing-spring-boot-applications-masterclass/blob/master/pom.xml
You can also work without the BOM but then have to bump all version definitions if there's a new Testcontainers release.
@@rieckpil Yea, you are right. applying BOM is better; my IDE cannot recognize the BOM yesterday. Right now it is good.
Thank you