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 に答える