Skip to content

Commit

Permalink
Update http4s-blaze-client (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored Oct 11, 2024
1 parent 0b93b1d commit f5459e4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
16 changes: 9 additions & 7 deletions src/sbt-test/ScalatraPlugin/browse/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ lazy val check = taskKey[Unit]("check if / is available")

check := {

import org.http4s._
import org.http4s.implicits._
import cats.effect.unsafe.implicits.global

val client = org.http4s.client.blaze.defaultClient
val uri = Uri.uri("http://localhost:8090/")
org.http4s.blaze.client.BlazeClientBuilder[cats.effect.IO].resource.use {
client =>
val uri = uri"http://localhost:8090/"

client.expect[String](uri).unsafePerformSyncAttempt.fold(
error => sys.error("unexpected result: " + error),
res => if (res != "hey") sys.error("unexpected output: " + res) else ()
)
client.expect[String](uri).map(
res => if (res != "hey") sys.error("unexpected output: " + res) else ()
)
}.unsafeRunSync()

}
2 changes: 1 addition & 1 deletion src/sbt-test/ScalatraPlugin/browse/project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.15.9a"
libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.23.16"

sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("org.scalatra.sbt" % "sbt-scalatra" % x)
Expand Down
16 changes: 9 additions & 7 deletions src/sbt-test/ScalatraPlugin/jetty-start/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ lazy val check = taskKey[Unit]("check if / is available")

check := {

import org.http4s._
import org.http4s.implicits._
import cats.effect.unsafe.implicits.global

val client = org.http4s.client.blaze.defaultClient
val uri = Uri.uri("http://localhost:8090/")
org.http4s.blaze.client.BlazeClientBuilder[cats.effect.IO].resource.use {
client =>
val uri = uri"http://localhost:8090/"

client.expect[String](uri).unsafePerformSyncAttempt.fold(
error => sys.error("unexpected result: " + error),
res => if (res != "hey") sys.error("unexpected output: " + res) else ()
)
client.expect[String](uri).map(
res => if (res != "hey") sys.error("unexpected output: " + res) else ()
)
}.unsafeRunSync()

}
2 changes: 1 addition & 1 deletion src/sbt-test/ScalatraPlugin/jetty-start/project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.15.9a"
libraryDependencies += "org.http4s" %% "http4s-blaze-client" % "0.23.16"

sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("org.scalatra.sbt" % "sbt-scalatra" % x)
Expand Down

0 comments on commit f5459e4

Please sign in to comment.