|
spring-test | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.mock.web.MockHttpServletRequest
org.springframework.mock.web.MockMultipartHttpServletRequest
public class MockMultipartHttpServletRequest
Mock implementation of the
MultipartHttpServletRequest
interface.
Useful for testing application controllers that access multipart uploads.
The MockMultipartFile
can be used to populate these mock requests
with files.
MockMultipartFile
Field Summary |
---|
Fields inherited from class org.springframework.mock.web.MockHttpServletRequest |
---|
DEFAULT_PROTOCOL, DEFAULT_REMOTE_ADDR, DEFAULT_REMOTE_HOST, DEFAULT_SERVER_ADDR, DEFAULT_SERVER_NAME, DEFAULT_SERVER_PORT |
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
MockMultipartHttpServletRequest()
|
Method Summary | |
---|---|
void |
addFile(org.springframework.web.multipart.MultipartFile file)
Add a file to this request. |
org.springframework.web.multipart.MultipartFile |
getFile(java.lang.String name)
|
java.util.Map<java.lang.String,org.springframework.web.multipart.MultipartFile> |
getFileMap()
|
java.util.Iterator<java.lang.String> |
getFileNames()
|
java.util.List<org.springframework.web.multipart.MultipartFile> |
getFiles(java.lang.String name)
|
org.springframework.util.MultiValueMap<java.lang.String,org.springframework.web.multipart.MultipartFile> |
getMultiFileMap()
|
java.lang.String |
getMultipartContentType(java.lang.String paramOrFileName)
|
org.springframework.http.HttpHeaders |
getMultipartHeaders(java.lang.String paramOrFileName)
|
org.springframework.http.HttpHeaders |
getRequestHeaders()
|
org.springframework.http.HttpMethod |
getRequestMethod()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.http.HttpServletRequest |
---|
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
Constructor Detail |
---|
public MockMultipartHttpServletRequest()
Method Detail |
---|
public void addFile(org.springframework.web.multipart.MultipartFile file)
MultipartFile.getName()
.
file
- multipart file to be addedpublic java.util.Iterator<java.lang.String> getFileNames()
getFileNames
in interface org.springframework.web.multipart.MultipartRequest
public org.springframework.web.multipart.MultipartFile getFile(java.lang.String name)
getFile
in interface org.springframework.web.multipart.MultipartRequest
public java.util.List<org.springframework.web.multipart.MultipartFile> getFiles(java.lang.String name)
getFiles
in interface org.springframework.web.multipart.MultipartRequest
public java.util.Map<java.lang.String,org.springframework.web.multipart.MultipartFile> getFileMap()
getFileMap
in interface org.springframework.web.multipart.MultipartRequest
public org.springframework.util.MultiValueMap<java.lang.String,org.springframework.web.multipart.MultipartFile> getMultiFileMap()
getMultiFileMap
in interface org.springframework.web.multipart.MultipartRequest
public java.lang.String getMultipartContentType(java.lang.String paramOrFileName)
getMultipartContentType
in interface org.springframework.web.multipart.MultipartRequest
public org.springframework.http.HttpMethod getRequestMethod()
getRequestMethod
in interface org.springframework.web.multipart.MultipartHttpServletRequest
public org.springframework.http.HttpHeaders getRequestHeaders()
getRequestHeaders
in interface org.springframework.web.multipart.MultipartHttpServletRequest
public org.springframework.http.HttpHeaders getMultipartHeaders(java.lang.String paramOrFileName)
getMultipartHeaders
in interface org.springframework.web.multipart.MultipartHttpServletRequest
|
spring-test | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |