Class AbstractMockMultipartHttpServletRequestBuilder<B extends AbstractMockMultipartHttpServletRequestBuilder<B>>
java.lang.Object
org.springframework.test.web.servlet.request.AbstractMockHttpServletRequestBuilder<B>
org.springframework.test.web.servlet.request.AbstractMockMultipartHttpServletRequestBuilder<B>
- Type Parameters:
B- a self reference to the builder type
- All Implemented Interfaces:
Mergeable, ConfigurableSmartRequestBuilder<B>, RequestBuilder, SmartRequestBuilder
- Direct Known Subclasses:
MockMultipartHttpServletRequestBuilder, MockMvcTester.MockMultipartMvcRequestBuilder
public abstract class AbstractMockMultipartHttpServletRequestBuilder<B extends AbstractMockMultipartHttpServletRequestBuilder<B>>
extends AbstractMockHttpServletRequestBuilder<B>
Base builder for
MockMultipartHttpServletRequest.- Since:
- 6.2
- Author:
- Rossen Stoyanchev, Arjen Poutsma, Stephane Nicoll
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected final MockHttpServletRequestcreateServletRequest(jakarta.servlet.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.part(jakarta.servlet.http.Part... parts) AddPartcomponents to the request.Methods inherited from class AbstractMockHttpServletRequestBuilder
accept, accept, acceptCharset, apiVersion, apiVersionInserter, buildRequest, characterEncoding, characterEncoding, content, content, contentType, contentType, contextPath, cookie, flashAttr, flashAttrs, formField, formFields, header, headers, headers, ifModifiedSince, ifNoneMatch, isMergeEnabled, locale, locale, param, params, pathInfo, postProcessRequest, principal, queryParam, queryParams, remoteAddress, requestAttr, secure, self, servletPath, session, sessionAttr, sessionAttrs, uri, uri, with
-
Constructor Details
-
AbstractMockMultipartHttpServletRequestBuilder
-
-
Method Details
-
file
Add a newMockMultipartFilewith the given content.- Parameters:
name- the name of the filecontent- the content of the file
-
file
Add the givenMockMultipartFile.- Parameters:
file- the multipart file
-
part
AddPartcomponents to the request.- Parameters:
parts- one or more parts to add- Since:
- 5.0
-
merge
Description copied from class:AbstractMockHttpServletRequestBuilderMerges the properties of the "parent" RequestBuilder accepting values only if not already set in "this" instance.- Specified by:
mergein interfaceMergeable- Overrides:
mergein classAbstractMockHttpServletRequestBuilder<B extends AbstractMockMultipartHttpServletRequestBuilder<B>>- Parameters:
parent- the parentRequestBuilderto inherit properties from- Returns:
- the result of the merge
-
createServletRequest
protected final MockHttpServletRequest createServletRequest(jakarta.servlet.ServletContext servletContext) Create a newMockMultipartHttpServletRequestbased on the suppliedServletContextand theMockMultipartFilesadded to this builder.- Overrides:
createServletRequestin classAbstractMockHttpServletRequestBuilder<B extends AbstractMockMultipartHttpServletRequestBuilder<B>>
-