In Play 1.2.4, I've been trying to work out why my functional test doesn't appear to POST the file data correctly (it's null). The controller action I'm testing is:
doUploadProfileImage(@Required File file, User user) And the functional test code calls it like this:
File file = VirtualFile.fromRelativePath("/test/imagetest.jpg").getRealFile(); Map<String,String> params = new HashMap<String,String>(); params.put("user.id", user.id.toString()); Map<String,File> files = new HashMap<String,File>(); files.put("file", file); Response response = POST(Router.reverse("ImageController.doUploadProfileImage").url, params, files); When I step through in debug, everything seems ok before the POST, but when I reach "doUploadProfileImage()", the "file" parameter is NULL.
Any tips on what's going on here? What's an easy way to inspect/log received/raw POST data by the play server?
thanks in advance, SM