Question

I'm currently working on improving test coverage in my app that uses Slick for connectivity to a MySQL database. In the past (my Java/Spring days), I have put the test inside a transaction and rolled back any changes on the database after the test was completed. Is there a way to accomplish the same functionality with Scala and Slick? If not, what options do I have for creating integration tests between my app and my database?

Was it helpful?

Solution

ScalaQuery is the old Slick and you should be able to use the same techniuqe described in this thread.

Noitice the withTransaction and rollback.

How do I rollback a session in ScalaQuery?

If there are any discrepancies between slick and ScalaQuery you may be able to find the updated usage now when you know what to look for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top