2015-11-06 31 views
0

我究竟是如何嘲笑這樣的事情(從WS庫Play的WSRequest的POST方法)方法:ScalaMock有兩個參數組

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)) 

回答

0

也許

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