What We Just Learned
Testing applications that use databases can be difficult. You have to make sure each scenario starts with a clean slate, but cleaning the slate can have its own pitfalls. In this chapter, we learned about the benefits and drawbacks of two strategies—transaction and truncation. To sum it up:
-
Liquibase is great for creating and evolving database schema.
-
ActiveJDBC is a useful library for quickly connecting to SQL databases.
-
Resetting state between scenarios is vital; otherwise, you get weird failures.
-
Transaction-based cleaning is preferred because it is fast, but it works only when there is one single-threaded process.
-
Truncation-based cleaning is a slower, brute-force technique that works in multiprocess and multithreaded ...
Get The Cucumber for Java Book now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.