ScalaTest: Assert exceptions in failed futures (non-blocking)

前端 未结 6 702
夕颜
夕颜 2020-12-24 10:54
import org.scalatest.{ FlatSpec, Matchers, ParallelTestExecution }
import org.scalatest.concurrent.ScalaFutures
import org.apache.thrift.TApplicationException

class         


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 11:20

    This was buried in a comment as well, but Scalatest's FutureValues mixin has you covered.

    Just use f.failed.futureValue shouldBe an[TApplicationException]

提交回复
热议问题