diff options
author | vlad <vlad@driver.xyz> | 2017-03-24 22:27:32 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-03-24 22:27:32 -0700 |
commit | f2d98d0d3f473c2a3ae51b11ce0386114bf87a0d (patch) | |
tree | 85cbd47eeec24925d2442cc4df08890f280e0d5c | |
parent | b97bc7242d1686a303f6366755652b6bf93e3851 (diff) | |
download | driver-core-f2d98d0d3f473c2a3ae51b11ce0386114bf87a0d.tar.gz driver-core-f2d98d0d3f473c2a3ae51b11ce0386114bf87a0d.tar.bz2 driver-core-f2d98d0d3f473c2a3ae51b11ce0386114bf87a0d.zip |
PDW-238 Session validity verification support for `AuthProvider`
-rw-r--r-- | src/test/scala/xyz/driver/core/AuthTest.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test/scala/xyz/driver/core/AuthTest.scala b/src/test/scala/xyz/driver/core/AuthTest.scala index e6025fb..76c2933 100644 --- a/src/test/scala/xyz/driver/core/AuthTest.scala +++ b/src/test/scala/xyz/driver/core/AuthTest.scala @@ -31,13 +31,14 @@ class AuthTest extends FlatSpec with Matchers with MockitoSugar with ScalatestRo } val authStatusService = new AuthProvider[User](authorization, NoLogger) { - override def authenticatedUser(implicit ctx: ServiceRequestContext): OptionT[Future, User] = OptionT.optionT[Future] { - if (ctx.contextHeaders.keySet.contains(AuthProvider.AuthenticationTokenHeader)) { - Future.successful(Some(BasicUser(Id[User]("1"), Set(TestRole)))) - } else { - Future.successful(Option.empty[User]) + override def authenticatedUser(implicit ctx: ServiceRequestContext): OptionT[Future, User] = + OptionT.optionT[Future] { + if (ctx.contextHeaders.keySet.contains(AuthProvider.AuthenticationTokenHeader)) { + Future.successful(Some(BasicUser(Id[User]("1"), Set(TestRole)))) + } else { + Future.successful(Option.empty[User]) + } } - } } import authStatusService._ |