0

How exactly should I mock something like this (the post method of Play's WSRequest from the WS library):

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

I've read through the ScalaMock page about this and I'm not having any success.

Can it also be stubbed? I'm trying this with no luck:

(mockRequest.post[String] (_ : String)(_ : Writeable[String], _: ContentTypeOf[String])).when(*,*,*).returns(Future.successful(mockResponse))
Andy Hull
  • 1,843
  • 2
  • 14
  • 16

1 Answers1

1

Maybe

(mockRequest.post(_ : String)(_ : Writeable[String], _: ContentTypeOf[String])).expects(*,*,*).returning(Future.successful(mockResponse))
Onilton Maciel
  • 3,559
  • 1
  • 25
  • 29