From 477804e21c3c61666a48b74f17caef04233c2363 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 4 Oct 2018 13:52:14 -0700 Subject: Fix dependencies in tests to accomodate project split --- .../test/scala/xyz/driver/core/rest/DriverRouteTest.scala | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'core-rest/src/test/scala/xyz/driver/core/rest/DriverRouteTest.scala') diff --git a/core-rest/src/test/scala/xyz/driver/core/rest/DriverRouteTest.scala b/core-rest/src/test/scala/xyz/driver/core/rest/DriverRouteTest.scala index cc0019a..d1172fa 100644 --- a/core-rest/src/test/scala/xyz/driver/core/rest/DriverRouteTest.scala +++ b/core-rest/src/test/scala/xyz/driver/core/rest/DriverRouteTest.scala @@ -8,8 +8,8 @@ import akka.http.scaladsl.server.{Directives, RejectionHandler, Route} import akka.http.scaladsl.testkit.ScalatestRouteTest import com.typesafe.scalalogging.Logger import org.scalatest.{AsyncFlatSpec, Matchers} +import org.slf4j.helpers.NOPLogger import xyz.driver.core.json.serviceExceptionFormat -import xyz.driver.core.logging.NoLogger import xyz.driver.core.rest.errors._ import scala.concurrent.Future @@ -17,7 +17,7 @@ import scala.concurrent.Future class DriverRouteTest extends AsyncFlatSpec with ScalatestRouteTest with SprayJsonSupport with Matchers with Directives { class TestRoute(override val route: Route) extends DriverRoute { - override def log: Logger = NoLogger + override def log: Logger = Logger(NOPLogger.NOP_LOGGER) } "DriverRoute" should "respond with 200 OK for a basic route" in { @@ -94,16 +94,6 @@ class DriverRouteTest } } - it should "respond with a 500 for DatabaseException" in { - val route = new TestRoute(akkaComplete(Future.failed[String](DatabaseException()))) - - Post("/api/v1/foo/bar") ~> route.routeWithDefaults ~> check { - handled shouldBe true - status shouldBe StatusCodes.InternalServerError - responseAs[ServiceException] shouldBe DatabaseException() - } - } - it should "add a `Connection: close` header to avoid clashing with envoy's timeouts" in { val rejectionHandler = RejectionHandler.newBuilder().handleNotFound(complete(StatusCodes.NotFound)).result() val route = new TestRoute(handleRejections(rejectionHandler)((get & path("foo"))(complete("OK")))) -- cgit v1.2.3