How to write your own DbUnit
summary
Shows how to build a small JUnit extension that reads YAML/CSV/XML data files, instantiates an etcd Java client, etcd dataset seeds keys before a test and compares persisted state after, throwing an exception on mismatches; the demo test runs green. Uses DBUnit concepts wrapped as DBWriter features (comparison strategies, expected datasets, cleanup) and notes integration with Flyway/Liquibase and testcontainers, plus pitfalls: multi-DB support, diff output detail, dataset merging and scripting for dynamic values.
AI-written summary · about
chapters (7)
- 0:00Introduction and welcome
- 0:22What is DBUnit and database writer
- 3:57Writing a custom JUnit extension
- 7:07Demo of etcd test case
- 8:54Drawbacks of custom solutions
- 13:27Maintenance and support considerations
- 14:14Q&A on integration with Liquibase/Flyway
related talks
46mSetting Up Data Driven Tests with Java Tools
38mSetting up data driven tests with Java tools
58mTDD for database related code, how is it possible?
59mSetting Up Data Driven Tests with Java Tools
50mSetting up Data Driven #Tests with #Java Tools
39mAndres Almiray: Setting Up Data Driven Tests
56mTDD: seriously, try it!
34mWhat are data unit tests and why we need them
