0

我为 Spark.streaming.mapWithState 的“更新函数”编写了一个单元测试,我需要模拟“org.apache.spark.streaming.State”参数,但它是一个密封类,编译器抱怨一个异常:从密封的非法继承类状态。我应该如何测试我的功能?

4

1 回答 1

0

A sealed trait can only be extended in the same source file as it's declared. So Scalamock has no chance of mocking this type.

于 2019-01-07T20:15:22.167 回答