ScalaMock有两个参数组的方法

时间:2015-11-06 01:04:08

标签: scala scalamock

我究竟应该如何模拟这样的东西(来自WS库的Play的WSRequest的post方法):

def post[T](body: T)(implicit wrt: Writeable[T], ct: ContentTypeOf[T]): Future[WSResponse]

我已阅读ScalaMock page about this并且我没有取得任何成功。

它也可以被打断吗?我正在尝试这个没有运气:

(mockRequest.post[String] (_ : String)(_ : Writeable[String], _: ContentTypeOf[String])).when(*,*,*).returns(Future.successful(mockResponse))

1 个答案:

答案 0 :(得分:0)

也许

(mockRequest.post(_ : String)(_ : Writeable[String], _: ContentTypeOf[String])).expects(*,*,*).returning(Future.successful(mockResponse))
相关问题