From e60d70fc01371f2f8ea27596ea91019cdc236994 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 26 Sep 2016 13:27:03 -0700 Subject: 401 rejections for absent permission --- src/test/scala/com/drivergrp/core/AuthTest.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/test/scala/com/drivergrp/core/AuthTest.scala') diff --git a/src/test/scala/com/drivergrp/core/AuthTest.scala b/src/test/scala/com/drivergrp/core/AuthTest.scala index 0e4841b..992ae83 100644 --- a/src/test/scala/com/drivergrp/core/AuthTest.scala +++ b/src/test/scala/com/drivergrp/core/AuthTest.scala @@ -4,7 +4,8 @@ import com.drivergrp.core.auth._ import akka.http.scaladsl.testkit.ScalatestRouteTest import akka.http.scaladsl.server._ import Directives._ -import akka.http.scaladsl.model.headers.RawHeader +import akka.http.scaladsl.model.headers.{HttpChallenges, RawHeader} +import akka.http.scaladsl.server.AuthenticationFailedRejection.CredentialsRejected import org.scalatest.mock.MockitoSugar import org.scalatest.{FlatSpec, Matchers} @@ -34,7 +35,10 @@ class AuthTest extends FlatSpec with Matchers with MockitoSugar with ScalatestRo } ~> check { handled shouldBe false - rejections should contain(ValidationRejection("User does not have the required permission CanAssignRoles", None)) + rejections should contain( + AuthenticationFailedRejection( + CredentialsRejected, + HttpChallenges.basic("User does not have the required permission CanAssignRoles"))) } } -- cgit v1.2.3