Skip to content

Commit

Permalink
Issue debasishg#282 added some more cases as sanity check that docker…
Browse files Browse the repository at this point in the history
… container is being set up properly with a password
  • Loading branch information
noahlz committed Nov 3, 2021
1 parent e8040c8 commit e866752
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/scala/com/redis/PoolSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,25 @@ class SecurePoolSpec extends BasePoolSpec {
response should equal(Some("PONG"))
}
}

private def shutdown(client: RedisClient) = {
client.disconnect
client.close()
}

// sanity check that the password set in the whisk docker container is working
describe("ad-hoc clients connecting to a secure redis server") {
it("should be rejected for no password") {
val client = new RedisClient(redisContainerHost, redisContainerPort)
an[Exception] shouldBe thrownBy(client.ping)
shutdown(client)
}

it("should be rejected for wrong password") {
val client = new RedisClient(redisContainerHost, redisContainerPort, secret = Some("WRONG"))
an[Exception] shouldBe thrownBy(client.ping)
shutdown(client)
}
}
}

0 comments on commit e866752

Please sign in to comment.