Class MockMultipartHttpServletRequestBuilder
java.lang.Object
org.springframework.test.web.servlet.request.AbstractMockHttpServletRequestBuilder<MockHttpServletRequestBuilder>
org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
- All Implemented Interfaces:
- Mergeable,- ConfigurableSmartRequestBuilder<MockHttpServletRequestBuilder>,- RequestBuilder,- SmartRequestBuilder
Default builder for 
MockMultipartHttpServletRequest.- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Arjen Poutsma, Stephane Nicoll
- 
Method SummaryModifier and TypeMethodDescriptionprotected final MockHttpServletRequestcreateServletRequest(ServletContext servletContext) Create a newMockMultipartHttpServletRequestbased on the suppliedServletContextand theMockMultipartFilesadded to this builder.Add a newMockMultipartFilewith the given content.file(MockMultipartFile file) Add the givenMockMultipartFile.Merges the properties of the "parent" RequestBuilder accepting values only if not already set in "this" instance.AddPartcomponents to the request.Methods inherited from class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilderaccept, accept, characterEncoding, characterEncoding, content, content, contentType, contentType, contextPath, cookie, flashAttr, flashAttrs, formField, formFields, header, headers, locale, locale, param, params, pathInfo, principal, queryParam, queryParams, remoteAddress, requestAttr, secure, servletPath, session, sessionAttr, sessionAttrs, uri, uri, withMethods inherited from class org.springframework.test.web.servlet.request.AbstractMockHttpServletRequestBuilderbuildRequest, isMergeEnabled, postProcessRequest, self
- 
Method Details- 
fileAdd a newMockMultipartFilewith the given content.- Parameters:
- name- the name of the file
- content- the content of the file
 
- 
fileAdd the givenMockMultipartFile.- Parameters:
- file- the multipart file
 
- 
partAddPartcomponents to the request.- Parameters:
- parts- one or more parts to add
- Since:
- 5.0
 
- 
mergeDescription copied from class:AbstractMockHttpServletRequestBuilderMerges the properties of the "parent" RequestBuilder accepting values only if not already set in "this" instance.- Specified by:
- mergein interface- Mergeable
- Overrides:
- mergein class- AbstractMockHttpServletRequestBuilder<MockHttpServletRequestBuilder>
- Parameters:
- parent- the parent- RequestBuilderto inherit properties from
- Returns:
- the result of the merge
 
- 
createServletRequestCreate a newMockMultipartHttpServletRequestbased on the suppliedServletContextand theMockMultipartFilesadded to this builder.- Overrides:
- createServletRequestin class- AbstractMockHttpServletRequestBuilder<MockHttpServletRequestBuilder>
 
 
-