From 78cfa5dd5622b3fd1ca2f558b0b4580f6171bd1e Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:57:33 +0530 Subject: [PATCH] fmt --- .github/workflows/http-conformance.yml | 3 +-- zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/http-conformance.yml b/.github/workflows/http-conformance.yml index 7c27fd2c5a..45f47b303b 100644 --- a/.github/workflows/http-conformance.yml +++ b/.github/workflows/http-conformance.yml @@ -74,7 +74,6 @@ jobs: # run: | # sed -i -e 's+(project in file("./zio-http"))+(project in file("./zio-http"))' build.sbt - - name: Compile - run: sbt clean compile + - name: Run HTTP Conformance Tests run: sbt "project zioHttpJVM" "testOnly zio.http.ConformanceSpec" diff --git a/zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala b/zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala index ae7f38ccde..c3ac193f5a 100644 --- a/zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala +++ b/zio-http/jvm/src/test/scala/zio/http/ServerSpec.scala @@ -522,17 +522,14 @@ object ServerSpec extends RoutesRunnableSpec { val route = Method.GET / "test" -> Handler.ok val app = Routes(route) - val requestWithoutHost = Request.get("/test") - - val res = app.deploy.runZIO(requestWithoutHost).map(_.status) + val res = app.deploy.status.run(path = Path.root / "test") assertZIO(res)(equalTo(Status.BadRequest)) } + test("should return 200 OK if Host header is present") { - val route = Method.GET / "test" -> Handler.ok - val app = Routes(route) - val requestWithHost = Request.get("/test").addHeader(Header.Host("localhost")) + val route = Method.GET / "test" -> Handler.ok + val app = Routes(route) - val res = app.deploy.runZIO(requestWithHost).map(_.status) + val res = app.deploy.status.run(path = Path.root / "test", headers = Headers(Header.Host("localhost"))) assertZIO(res)(equalTo(Status.Ok)) } }