diff --git a/src/main/scala/net/yoshinorin/qualtet/Modules.scala b/src/main/scala/net/yoshinorin/qualtet/Modules.scala index 3ef62528..87564fb3 100644 --- a/src/main/scala/net/yoshinorin/qualtet/Modules.scala +++ b/src/main/scala/net/yoshinorin/qualtet/Modules.scala @@ -63,7 +63,7 @@ class Modules(tx: Transactor[IO]) { val config = ApplicationConfig.load given log4catsLogger: Log4CatsLoggerFactory[IO] = Log4CatsSlf4jFactory.create[IO] - given dbContext: DoobieExecuter = new DoobieExecuter(tx) + given doobieExecuterContext: DoobieExecuter = new DoobieExecuter(tx) val migrator: Migrator = new Migrator(config.db) diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala index 8c246588..8f22fa7e 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/contentTaggings/ContentTaggingServiceSpec.scala @@ -12,7 +12,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.domains.contentTaggings.ContentTaggingServiceSpec class ContentTaggingServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieExecuter = new DoobieExecuter(fixtureTx) + given doobieExecuterContext: DoobieExecuter = new DoobieExecuter(fixtureTx) val requestContents: List[RequestContent] = { List(1, 2) @@ -44,7 +44,7 @@ class ContentTaggingServiceSpec extends AnyWordSpec with BeforeAndAfterAll { val contents = contentService.findByPathWithMeta(Path("/test/ContentTaggingServiceSpec-1")).unsafeRunSync().get val shouledDeleteContentTaggings = (contents1.id, Seq(contents.tags.head.id, contents.tags.last.id)) - dbContext.transact(contentTaggingService.bulkDeleteActions(shouledDeleteContentTaggings)).unsafeRunSync() + doobieExecuterContext.transact(contentTaggingService.bulkDeleteActions(shouledDeleteContentTaggings)).unsafeRunSync() val result = contentService.findByPathWithMeta(Path("/test/ContentTaggingServiceSpec-1")).unsafeRunSync().get assert(result.tags.size === 1) @@ -53,7 +53,7 @@ class ContentTaggingServiceSpec extends AnyWordSpec with BeforeAndAfterAll { "not be delete any tag" in { val beforeDelete = contentService.findByPath(Path("/test/ContentTaggingServiceSpec-2")).unsafeRunSync().get - dbContext.transact(contentTaggingService.bulkDeleteActions(beforeDelete.id, Seq())).unsafeRunSync() + doobieExecuterContext.transact(contentTaggingService.bulkDeleteActions(beforeDelete.id, Seq())).unsafeRunSync() val afterDelete = contentService.findByPathWithMeta(Path("/test/ContentTaggingServiceSpec-2")).unsafeRunSync().get assert(afterDelete.tags.size === 3) diff --git a/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala b/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala index 32c06d6d..3a5a802f 100644 --- a/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala +++ b/src/test/scala/net/yoshinorin/qualtet/domains/tags/TagServiceSpec.scala @@ -12,7 +12,7 @@ import cats.effect.unsafe.implicits.global // testOnly net.yoshinorin.qualtet.domains.TagServiceSpec class TagServiceSpec extends AnyWordSpec with BeforeAndAfterAll { - given dbContext: DoobieExecuter = new DoobieExecuter(fixtureTx) + given doobieExecuterContext: DoobieExecuter = new DoobieExecuter(fixtureTx) val requestContents = makeRequestContents(10, "tagService") @@ -42,7 +42,7 @@ class TagServiceSpec extends AnyWordSpec with BeforeAndAfterAll { "findByContentId" in { val r = (for { c <- contentService.findByPath(Path("/test/tagService-4")) - t <- dbContext.transact(tagService.findByContentIdActions(c.get.id)) + t <- doobieExecuterContext.transact(tagService.findByContentIdActions(c.get.id)) } yield t).unsafeRunSync() assert(r.head.name === TagName("tagServiceTag4")) } diff --git a/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala b/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala index bfa600cb..363b925d 100644 --- a/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala +++ b/src/test/scala/net/yoshinorin/qualtet/fixture/Fixture.scala @@ -66,7 +66,7 @@ object Fixture { ) private val modules = Modules(fixtureTx) given log4catsLogger: Log4CatsLoggerFactory[IO] = Log4CatsSlf4jFactory.create[IO] - given dbContext: DoobieExecuter = new DoobieExecuter(fixtureTx) + given doobieExecuterContext: DoobieExecuter = new DoobieExecuter(fixtureTx) val migrator = modules.migrator val articleService = modules.articleService