sql

All things SQL and JDBC...
mjw 2020-03-30T16:43:32.090500Z

When testing functionality that interacts with a database, rather than attempt to mock any of the next.jdbc functions, I’ve been using a test-only database to verify that everything works as expected. Is this a common approach, or do you all manage tests for db-facing functionality in a different manner?

dharrigan 2020-03-30T16:46:18.091600Z

I think, as always, it depends 🙂 I do both, depending. I mock out db calls if it's trival and I'm only interested in the data, but I also hit a test database to test out things like stored procedures, or transaction checks etc...

👍 1
dharrigan 2020-03-30T16:46:29.091900Z

It's all good, so whatever works for you is good 🙂

seancorfield 2020-03-30T17:18:00.093500Z

@matt.wistrand At work we have a local test DB (Percona to match production) and we just tear it down and run all the migrations to get it up to the appropriate state for testing. For some tests, we mock out the storage functions, but for most things we just test directly against that local DB.

👍 1
mjw 2020-03-30T17:23:15.094400Z

Thanks!