Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javaOptions in Test += "-Dconfig.file=conf/application.test.conf"
- include "application.conf"
- slick.dbs {
- test {
- driver="slick.driver.H2Driver$"
- db.driver="org.h2.Driver"
- db.url="jdbc:h2:mem:test;MODE=PostgreSQL"
- db.username="sa"
- db.password=""
- }
- }
- package dao
- import org.scalatest.{BeforeAndAfterAll, FunSpec}
- import org.scalatestplus.play.OneAppPerSuite
- import play.api.Application
- import play.api.db.evolutions.Evolutions
- import play.api.db.DBApi
- abstract class DaoFunSpec extends FunSpec with OneAppPerSuite with BeforeAndAfterAll {
- lazy implicit val db = app.injector.instanceOf[DBApi].database("test")
- override def beforeAll() {
- Evolutions.applyEvolutions(db)
- }
- override def afterAll() {
- Evolutions.cleanupEvolutions(db)
- }
- def userDao(implicit app: Application) = {
- Application.instanceCache[UserDao].apply(app)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement