0

我应该如何模拟这样的事情(来自 WS 库的 Play 的 WSRequest 的 post 方法):

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

我已经阅读了有关此的 ScalaMock 页面,但没有任何成功。

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

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

1 回答 1

1

也许

(mockRequest.post(_ : String)(_ : Writeable[String], _: ContentTypeOf[String])).expects(*,*,*).returning(Future.successful(mockResponse))
于 2015-11-06T03:18:44.943 回答