MockMultipartHttpServletRequest pre-defines method "POST" and content type "multipart/form-data"

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3587 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-08-15 22:46:15 +00:00
parent 93fb8760ff
commit 29c3bb3152
3 changed files with 32 additions and 13 deletions
@@ -47,6 +47,12 @@ public class MockMultipartHttpServletRequest extends MockHttpServletRequest impl
new LinkedMultiValueMap<String, MultipartFile>();
public MockMultipartHttpServletRequest() {
setMethod("POST");
setContentType("multipart/form-data");
}
/**
* Add a file to this request. The parameter name from the multipart
* form is taken from the {@link MultipartFile#getName()}.