如何使用隐式类型标记参数
模拟多态方法val mockInterface = mock[SampleInterface]
trait SampleInterface {
def fetchType[M <: Model : TypeTag]: Future[Unit]
}
答案 0 :(得分:1)
(mockInterface.fetchType[SampleModel](_: TypeTag[SampleModel]))
.expects(typeTag[SampleMode])
.returning(Future.successful())