From d0c1c407b62d7adfc5c762aee9165c6ea1692e2e Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:21:31 +0530 Subject: [PATCH] Update RoutesSpec.scala --- zio-http/jvm/src/test/scala/zio/http/RoutesSpec.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zio-http/jvm/src/test/scala/zio/http/RoutesSpec.scala b/zio-http/jvm/src/test/scala/zio/http/RoutesSpec.scala index 177f6d7a27..7051148fdb 100644 --- a/zio-http/jvm/src/test/scala/zio/http/RoutesSpec.scala +++ b/zio-http/jvm/src/test/scala/zio/http/RoutesSpec.scala @@ -18,6 +18,7 @@ package zio.http import zio._ import zio.test._ + import zio.http.codec.PathCodec object RoutesSpec extends ZIOHttpSpec { @@ -123,10 +124,13 @@ object RoutesSpec extends ZIOHttpSpec { long <- ZIO.service[Long] } yield s"Int: $int, Long: $long" + val loggingAspect: HandlerAspect[Any, Nothing] = HandlerAspect.before { _ => + ZIO.log("Request received") + } val handler: Handler[Int & Long, Nothing, Request, Response] = Handler.fromZIO(routeWithMultipleDeps.map(result => Response.text(result))) - val route: Route[Int & Long, Nothing] = RoutePattern(Method.GET, Path.root) -> handler + val route: Route[Int & Long, Nothing] = RoutePattern(Method.GET, Path.root) -> handler @@ loggingAspect val routes = Routes(route) val env = ZEnvironment(42).add(100L)