How to populate database only once before @Test methods in spring test?

前端 未结 5 1420
小蘑菇
小蘑菇 2020-12-08 08:00

My next problem testing spring service layer with junit4 is: How to call script that populates database only once before all @Test methods: I want to execute this once befor

5条回答
  •  失恋的感觉
    2020-12-08 08:50

    Use Springs Embedded Database Support

    
        
        
    
    

    or Springs Initialize Database Support

    
        
        
    
    

    @See http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html#jdbc-embedded-database-support

提交回复
热议问题