Created
October 19, 2016 00:38
-
-
Save devshorts/3653230959176ac5c96a307b4f3acd1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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