From 4cfa6a09c6f6692f5513ff6e31f261a020d07068 Mon Sep 17 00:00:00 2001 From: Satya Boora Date: Tue, 10 Apr 2018 12:33:02 -0700 Subject: Use AuthenticationFailedRejection to send 401 back to the client (#151) --- src/test/scala/xyz/driver/core/AuthTest.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/test') diff --git a/src/test/scala/xyz/driver/core/AuthTest.scala b/src/test/scala/xyz/driver/core/AuthTest.scala index 6e5862a..a7707aa 100644 --- a/src/test/scala/xyz/driver/core/AuthTest.scala +++ b/src/test/scala/xyz/driver/core/AuthTest.scala @@ -79,7 +79,8 @@ class AuthTest extends FlatSpec with Matchers with ScalatestRouteTest { } ~> check { // handled shouldBe false - rejections should contain(ValidationRejection("Wasn't able to find authenticated user for the token provided")) + val challenge = HttpChallenges.basic("Failed to authenticate user") + rejections should contain(AuthenticationFailedRejection(CredentialsRejected, challenge)) } } -- cgit v1.2.3