Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active January 7, 2020 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamw/8e754b3e06bd9bd3ee3629b2cb6c609f to your computer and use it in GitHub Desktop.
Save adamw/8e754b3e06bd9bd3ee3629b2cb6c609f to your computer and use it in GitHub Desktop.
override protected def beforeAll(): Unit = {
super.beforeAll()
transactor = Transactor(
(),
(_: Unit) => Resource.pure(null),
KleisliInterpreter[IO](
Blocker.liftExecutionContext(ExecutionContext.global))
.ConnectionInterpreter,
Strategy.void
)
}
def newStubDaoConstantPoints(points: Int,
updatedPoints: AtomicInteger): Dao = new Dao {
override def currentPoints(userId: UUID): ConnectionIO[Int] =
points.pure[ConnectionIO]
override def updatePoints(userId: UUID, value: Int): ConnectionIO[Unit] =
Sync[ConnectionIO].delay(updatedPoints.set(value))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment