找不到参数sz的隐式值:org.scalatest.enablers.Size [akka.Done]

时间:2019-01-31 09:36:49

标签: scala akka akka-stream

我应该添加什么隐式参数以及如何添加?

我已经尝试添加:

  implicit val sz = Size;

但是它不起作用。

    val done = Consumer
    .committableSource(consumerSettings, Subscriptions.topics(topic))
    .map(msg => messageHandler(msg))
    .toMat(Sink.ignore)(Keep.both)
    .mapMaterializedValue(DrainingControl.apply)
    .run()

  Await.result(done.drainAndShutdown(), 5.seconds) should have size 20

投掷:

errors: Error:(85, 68) could not find implicit value for parameter sz: org.scalatest.enablers.Size 
[akka.Done] Await.result(done.drainAndShutdown(), 5.seconds) should have size 20 

Error:(85, 68) not enough arguments for method size: (implicit sz: org.scalatest.enablers.Size
[akka.Done])org.scalatest.Assertion. Unspecified value parameter sz. Await.result(done.drainAndShutdown(), 5.seconds) should have size 20

0 个答案:

没有答案