aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/AuthTest.scala
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-07-28 02:09:51 -0700
committervlad <vlad@driver.xyz>2017-07-28 02:09:51 -0700
commitc6d32c5d4296e7447f0e5bb2da921e04fb23a90b (patch)
treec23d9e94ccaf18b36500cc3b39beac0eae2db08a /src/test/scala/xyz/driver/core/AuthTest.scala
parent626e751dde1ca98c04b72e79a88d515a39a77798 (diff)
downloaddriver-core-c6d32c5d4296e7447f0e5bb2da921e04fb23a90b.tar.gz
driver-core-c6d32c5d4296e7447f0e5bb2da921e04fb23a90b.tar.bz2
driver-core-c6d32c5d4296e7447f0e5bb2da921e04fb23a90b.zip
Users hierarchy simplification
Diffstat (limited to 'src/test/scala/xyz/driver/core/AuthTest.scala')
-rw-r--r--src/test/scala/xyz/driver/core/AuthTest.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/scala/xyz/driver/core/AuthTest.scala b/src/test/scala/xyz/driver/core/AuthTest.scala
index 9018a3e..9abc7e0 100644
--- a/src/test/scala/xyz/driver/core/AuthTest.scala
+++ b/src/test/scala/xyz/driver/core/AuthTest.scala
@@ -9,6 +9,7 @@ import org.scalatest.mock.MockitoSugar
import org.scalatest.{FlatSpec, Matchers}
import pdi.jwt.{Jwt, JwtAlgorithm}
import xyz.driver.core.auth._
+import xyz.driver.core.domain.Email
import xyz.driver.core.logging._
import xyz.driver.core.rest._
@@ -51,7 +52,14 @@ class AuthTest extends FlatSpec with Matchers with MockitoSugar with ScalatestRo
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))))
+ Future.successful(Some(AuthTokenUserInfo(
+ Id[User]("1"),
+ authUserId = Id[AuthUser]("2"),
+ Email("foo", "bar"),
+ emailVerified = true,
+ audience = "driver",
+ roles = Set(TestRole)
+ )))
} else {
Future.successful(Option.empty[User])
}