public class MockMultipartHttpServletRequestBuilder extends MockHttpServletRequestBuilder
MockMultipartHttpServletRequest
.Modifier and Type | Field and Description |
---|---|
private java.util.List<MockMultipartFile> |
files |
private MultiValueMap<java.lang.String,Part> |
parts |
Constructor and Description |
---|
MockMultipartHttpServletRequestBuilder(java.lang.String urlTemplate,
java.lang.Object... uriVariables)
Package-private constructor.
|
MockMultipartHttpServletRequestBuilder(java.net.URI uri)
Package-private constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MockHttpServletRequest |
createServletRequest(ServletContext servletContext)
Create a new
MockMultipartHttpServletRequest based on the
supplied ServletContext and the MockMultipartFiles
added to this builder. |
MockMultipartHttpServletRequestBuilder |
file(MockMultipartFile file)
Add the given MockMultipartFile.
|
MockMultipartHttpServletRequestBuilder |
file(java.lang.String name,
byte[] content)
Create a new MockMultipartFile with the given content.
|
java.lang.Object |
merge(java.lang.Object parent)
Merges the properties of the "parent" RequestBuilder accepting values
only if not already set in "this" instance.
|
MockMultipartHttpServletRequestBuilder |
part(Part... parts)
Add
Part components to the request. |
accept, accept, buildRequest, characterEncoding, content, content, contentType, contentType, contextPath, cookie, flashAttr, flashAttrs, header, headers, isMergeEnabled, locale, locale, param, params, pathInfo, postProcessRequest, principal, requestAttr, secure, servletPath, session, sessionAttr, sessionAttrs, with
private final java.util.List<MockMultipartFile> files
private final MultiValueMap<java.lang.String,Part> parts
MockMultipartHttpServletRequestBuilder(java.lang.String urlTemplate, java.lang.Object... uriVariables)
MockMvcRequestBuilders
.
For other ways to initialize a MockMultipartHttpServletRequest
,
see MockHttpServletRequestBuilder.with(RequestPostProcessor)
and the
RequestPostProcessor
extension point.
urlTemplate
- a URL template; the resulting URL will be encodeduriVariables
- zero or more URI variablesMockMultipartHttpServletRequestBuilder(java.net.URI uri)
MockMvcRequestBuilders
.
For other ways to initialize a MockMultipartHttpServletRequest
,
see MockHttpServletRequestBuilder.with(RequestPostProcessor)
and the
RequestPostProcessor
extension point.
uri
- the URLpublic MockMultipartHttpServletRequestBuilder file(java.lang.String name, byte[] content)
name
- the name of the filecontent
- the content of the filepublic MockMultipartHttpServletRequestBuilder file(MockMultipartFile file)
file
- the multipart filepublic MockMultipartHttpServletRequestBuilder part(Part... parts)
Part
components to the request.parts
- one or more parts to addpublic java.lang.Object merge(java.lang.Object parent)
MockHttpServletRequestBuilder
merge
in interface Mergeable
merge
in class MockHttpServletRequestBuilder
parent
- the parent RequestBuilder
to inherit properties fromprotected final MockHttpServletRequest createServletRequest(ServletContext servletContext)
MockMultipartHttpServletRequest
based on the
supplied ServletContext
and the MockMultipartFiles
added to this builder.createServletRequest
in class MockHttpServletRequestBuilder