I'm testing a service against a dummy endpoint, with the following code:
ws.url(dummyService).withHeaders(HeaderNames.CONTENT_TYPE -> "multipart/form-data; boundary=-----{}}AAA{{}-----").post(myData)
This generates the request ok, the headers are set properly.
In my mock service, I process the response like so:
def checkData = Action(parse.multipartFormData) { request =>
request.body.files.find(_.filename.endsWith("testfail.pdf")) match {
case Some(invalidFile) => BadRequest("Parse Fail")
case None => Ok("Parse Success")
}
}
When I run the test, I get an error 400, and the following message:
For request 'POST /TEST/process' [Missing boundary header]
What am I doing wrong?