Populate a database with TestContainers in a SpringBoot integration test

前端 未结 6 1860
自闭症患者
自闭症患者 2021-02-20 07:10

I am testing TestContainers and I would like to know how to populate a database executing a .sql file to create the structure and add some rows.

How to do it?

         


        
6条回答
  •  感情败类
    2021-02-20 08:10

    After some reviews, I think that it is interesting to review the examples from Spring Data JDBC which use Test Containers:

    Note: Use Java 8

    git clone https://github.com/spring-projects/spring-data-jdbc.git
    mvn clean install -Pall-dbs
    

    I will create a simple project adding some ideas about previous project referenced.

    Juan Antonio

提交回复
热议问题