springtestdbunit / spring-test-dbunit

Integration between the Spring testing framework and DBUnit
http://springtestdbunit.github.com/spring-test-dbunit/
Apache License 2.0
475 stars 238 forks source link

Reset auto increment #83

Closed Invizible closed 8 years ago

Invizible commented 9 years ago

I have a test class and after inserting in db auto incremented value does not start from 1 for next test methods, it continues from the last value. How can I reset auto increment, so for each test method auto incremented id will start from 1?

Invizible commented 9 years ago

I found work around. We can create a separate setup dataset file for test method (which saves new data) with one row where id is a big number like 1111 and in expected dataset we can be sure that 1112 id value is the next auto incremented value.