Data tests inherit from a common class wherein get/setters for repositories are kept. The parent then inherits from: AbstractTransactionalSpringContextTests
When CRUD operations are run, they are run against the specified database, but all alterations are cleaned up and reverted behind-the-scenes for you as though the database isn’t being touched. One may inherit from AbstractTransactionalSpringContextTests and yet override the cleanup that makes transactions effectively (de facto, shall we say) artificial by giving SetComplete(); after a transaction or at the end of a test(method).
Other links:
No comments:
Post a Comment