ScalaTest: Assert exceptions in failed futures (non-blocking)
问题 import org.scalatest.{ FlatSpec, Matchers, ParallelTestExecution } import org.scalatest.concurrent.ScalaFutures import org.apache.thrift.TApplicationException class Test extends FlatSpec with Matchers with ScalaFutures with ParallelTestExecution { it should "throw org.apache.thrift.TApplicationException for invalid Ids" in { val future: Future[Response] = ThriftClient.thriftRequest whenReady(future) { res => { intercept[TApplicationException] { } } } } } Question: How do you assert expected