The order of calls makePersistent() and addTearDownClass() in localSetUp methods is significant: addTearDownClass() must be called before makePersistent(). This ensures that the next test run will cleanup the database.
Currently, many tests call makePersistent() before addTearDownClass(). Given that there is data in the database that will cause a duplicate key exception, the database will not be cleaned up, because tear down classes have not been added at the time the exception is thrown.
Description
The order of calls makePersistent() and addTearDownClass() in localSetUp methods is significant: addTearDownClass() must be called before makePersistent(). This ensures that the next test run will cleanup the database.
Currently, many tests call makePersistent() before addTearDownClass(). Given that there is data in the database that will cause a duplicate key exception, the database will not be cleaned up, because tear down classes have not been added at the time the exception is thrown.