| This test helper method seems extremely useful to actually assert expectations at the level of generated JDBC commands, yet the approach based on applying Mockito on the Connection has it generate a very significant amount of stacktraces at runtime. These stacktraces seem to be an inherent side-effect of using Mockito and I guess this is also part of making this library usable and effective so I suspect that could not be improved much. My conclusion is that while this approach is great, our specific needs might warrant creating an actual ad hoc proxy driver; that would be quite some more work but might be worth it to speedup test execution, and perhaps in some cases even useful to completely mock the database - for example this would make it possible to run some tests which depend on very specific RDBMS versions without running the database as we could hardcode the whole JDBC interaction in a test fixture. |