Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alfabetacain committed Jan 7, 2023
1 parent 411c821 commit 6fb881f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,15 @@ trait TestScenarios { self: FunSuite =>
def connectionScenario(redis: RedisCommands[IO, String, String]): IO[Unit] = {
val clientName = "hello_world"
for {
_ <- redis.ping.flatMap(pong => IO(assertEquals(pong, "PONG"))).void
_ <- redis.getClientName().flatMap(name => IO(assertEquals(name, None)))
_ <- redis
.setClientName(clientName)
.flatMap(result => IO(assert(result, s"Failed to set client name: '$clientName'")))
_ <- redis.getClientName().flatMap(name => IO(assertEquals(name, Some(clientName))))
pong <- redis.ping
_ <- IO(assertEquals(pong, "PONG"))
oldClientName <- redis.getClientName()
_ <- IO(assertEquals(oldClientName, None))
res <- redis
.setClientName(clientName)
_ <- IO(assert(res, s"Failed to set client name: '$clientName'"))
newClientName <- redis.getClientName()
_ <- IO(assertEquals(newClientName, Some(clientName)))
_ <- redis.getClientId()
} yield ()
}
Expand Down

0 comments on commit 6fb881f

Please sign in to comment.