How to load DBUnit test data once per case with Spring Test

前端 未结 4 1693

Spring Test helpfully rolls back any changes made to the database within a test method. This means that it is not necessary to take the time to delete/reload the test data

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 11:50

    Spring Test and DbUnit is two excellent frameworks. But it doesn't make sense to combine them. Since Spring Test execute a rollback on the connection, it cleans up afterwards, while DbUnit cleans up and insert test data in the @Before method.

    Use Spring if you're not dependent on any dynamic data and dbUnit otherwise.

提交回复
热议问题