Skip to content

Commit

Permalink
simplifies test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrutiVerma97 committed Jan 24, 2022
1 parent d46f00a commit c03af1b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions zio-http/src/test/scala/zhttp/http/EncodeClientRequestSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import io.netty.handler.codec.http.{FullHttpRequest, HttpHeaderNames, HttpVersio
import zhttp.internal.HttpGen
import zhttp.service.Client.ClientRequest
import zhttp.service.{Client, EncodeClientParams}
import zio.ZIO
import zio.random.Random
import zio.test.Assertion._
import zio.test._
Expand Down Expand Up @@ -50,10 +49,12 @@ object EncodeClientRequestSpec extends DefaultRunnableSpec with EncodeClientPara
assert(req.uri())(equalTo(params.url.relative.asString))
}
} +
testM("uri as path") {
val url = ZIO.fromEither(URL.fromString("http://localhost:8090/a/b/c?q=123"))
val actual = url.map(a => encodeClientParams(HttpVersion.HTTP_1_1, ClientRequest(Method.GET, a)).uri())
assertM(actual)(equalTo("/a/b/c?q=123"))
test("uri as path") {
val actual = encodeClientParams(
HttpVersion.HTTP_1_1,
ClientRequest(Method.GET, URL(!! / "a" / "b", queryParams = Map("q" -> List("123")))),
).uri()
assert(actual)(equalTo("/a/b?q=123"))
} +
testM("uri on HttpData.File") {
check(HttpGen.clientParamsForFileHttpData()) { params =>
Expand Down

1 comment on commit c03af1b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance Benchmark:

Concurrency: 256
Requests/sec: 938849.56

Please sign in to comment.