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

DBUnit Unique Constraint not thrown #88

Closed dbclkclk closed 8 years ago

dbclkclk commented 8 years ago

Hi:

I have a setup where I am using @Databasesetup annotation to load some test data in my DB. After, I have a test that tries to insert data with username and email which have the same values from what was inserted through @Databasesetup. However, I am not getting the unique constraint exception and my data gets inserted.

Any ideas how I can get this exception thrown?

Thanks.

dbclkclk commented 8 years ago

OK, I tried removing the @transactional annoational and instead used @databasesetup with @databaseteardown. I got the @databasesetup to work however, the @databaseteardown isn't removing the record that was installed during the setup.