sjurgemeyer / spock-extensions

2 stars 2 forks source link

DatabaseOperation.DELETE #1

Open Kanti1702 opened 7 years ago

Kanti1702 commented 7 years ago

While using @SingleExecution, if test case have to pre-populate records in db before execute and clean these records on test case completion I'm using @DbUnit. DatabaseOperation.DELETE is used to clean the db after test case completion (tearDown), the issue is my test case will run 5 times and this tearDown also run 5 times, but it should only run 1 time as my setUp method is run 1 time only as i'm using @SingleExecution

Because of my dbsetup run multiple times, my test cases failed, If I give DatabaseOperation.NONE as tearDown then it will not delete the record from db after test complete and test runs fine but my db is contains unnecessary records (test case records)