-
Hi, I understand that class DoobieDaoTestSuite extends FunSuite with doobie.munit.IOChecker {
override val colors = doobie.util.Colors.None // just for docs
val transactor = Transactor.fromDriverManager[IO](
"com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://localhost;integratedSecurity=false;TrustServerCertificate=true;databaseName=XXXX", "sa", "XXXX"
)
val dao = new DoobieDao()
test("trivial") { check(dao.loadAll()) }
} This model is incompatible with the https://github.com/testcontainers/testcontainers-scala model of exposing the container in a closure, per test: class DoobieDaoTestContainersTestSuite extends FunSuite with TestContainerForEach {
// override val containerDef: MSSQLServerContainer.Def = MSSQLServerContainer.Def(urlParams = Map("databaseName" -> "pride-and-joy-next"))
override val containerDef: MSSQLServerContainer.Def = MSSQLServerContainer.Def()
val dao = new DoobieDao()
test("trivial") {
withContainers(container => {
val transactor = Transactor.fromDriverManager[IO](
container.driverClassName, container.jdbcUrl, container.username, container.password
)
val y = transactor.yolo
import y._
val query = dao.loadAll();
query.check.unsafeRunSync()
})
}
} Unfortunately, calling Can you please give me some guidance on how to proceed, so I can use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @yatesco I would recommend looking at how The idea would be to implement your own |
Beta Was this translation helpful? Give feedback.
Hi @yatesco I would recommend looking at how
check
is implemented in Checker/IOChecker trait.The idea would be to implement your own
check
which takes an implicittransactor: Transactor[M]
argument and use that inval report = U.unsafeRunSync(analyze(args).transact(transactor))
.