I am using junit4 with spring to test my rest web services. For this, I am using HSQL in memory database.
To clean the records after every test case, I am removing all the records from tables.
But I want to delete only inserted records. I am adding data to database in two places:
In Junit test cases.
In the rest services.
I am making http calls to test the services. Also, I am using same in-memory database in rest services.
Kindly help me in removing only inserted records after each test cases.
Edited: My concern is deleting the inserted records in http calls to rest services. It is really hard to keep track of those records. They are part of my actual code.