Skip to content

Instantly share code, notes, and snippets.

@devshorts
Created October 19, 2016 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devshorts/3653230959176ac5c96a307b4f3acd1c to your computer and use it in GitHub Desktop.
Save devshorts/3653230959176ac5c96a307b4f3acd1c to your computer and use it in GitHub Desktop.
// finagle 6.1.33
class ClientObjectTests extends FlatSpec with Matchers with BeforeAndAfterAll {
"A client" should "be closeable" in {
val client =
ClientBuilder()
.dest("localhost:1")
.codec(Http())
.hostConnectionLimit(1)
.build()
val r =
RequestBuilder.safeBuildGet(
RequestBuilder.create()
.url(new URL("http://localhost:1/data")))
val request = client(r).rescue {
case e: Exception => Future.value("this is ok")
}
println(Await.result(request))
Await.result(client.close())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment