类 MockMultipartHttpServletRequestBuilder
java.lang.Object
cn.taketoday.test.web.servlet.request.MockHttpServletRequestBuilder
cn.taketoday.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
- 所有已实现的接口:
cn.taketoday.beans.Mergeable,ConfigurableSmartRequestBuilder<MockHttpServletRequestBuilder>,RequestBuilder,SmartRequestBuilder
Default builder for
MockMultipartHttpServletRequest.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Arjen Poutsma
-
字段概要
字段修饰符和类型字段说明private final List<MockMultipartFile>private final cn.taketoday.util.MultiValueMap<String,jakarta.servlet.http.Part> -
构造器概要
构造器构造器说明MockMultipartHttpServletRequestBuilder(cn.taketoday.http.HttpMethod httpMethod, String urlTemplate, Object... uriVariables) Variant ofMockMultipartHttpServletRequestBuilder(String, Object...)that also accepts anHttpMethod.MockMultipartHttpServletRequestBuilder(cn.taketoday.http.HttpMethod httpMethod, URI uri) MockMultipartHttpServletRequestBuilder(String urlTemplate, Object... uriVariables) Package-private constructor.Variant ofMockMultipartHttpServletRequestBuilder(String, Object...)with aURI. -
方法概要
修饰符和类型方法说明protected final MockHttpServletRequestcreateServletRequest(jakarta.servlet.ServletContext servletContext) Create a newMockMultipartHttpServletRequestbased on the suppliedServletContextand theMockMultipartFilesadded to this builder.file(MockMultipartFile file) Add the givenMockMultipartFile.Add a newMockMultipartFilewith the given content.private CharsetgetCharsetOrDefault(jakarta.servlet.http.Part part, Charset defaultCharset) 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.从类继承的方法 cn.taketoday.test.web.servlet.request.MockHttpServletRequestBuilder
accept, accept, buildRequest, characterEncoding, characterEncoding, content, content, contentType, contentType, contextPath, cookie, flashAttr, flashAttrs, header, headers, isMergeEnabled, locale, locale, param, params, pathInfo, postProcessRequest, principal, queryParam, queryParams, remoteAddress, requestAttr, secure, servletPath, session, sessionAttr, sessionAttrs, with
-
字段详细资料
-
files
-
parts
-
-
构造器详细资料
-
MockMultipartHttpServletRequestBuilder
Package-private constructor. Use static factory methods inMockMvcRequestBuilders.For other ways to initialize a
MockMultipartHttpServletRequest, seeMockHttpServletRequestBuilder.with(RequestPostProcessor)and theRequestPostProcessorextension point.- 参数:
urlTemplate- a URL template; the resulting URL will be encodeduriVariables- zero or more URI variables
-
MockMultipartHttpServletRequestBuilder
MockMultipartHttpServletRequestBuilder(cn.taketoday.http.HttpMethod httpMethod, String urlTemplate, Object... uriVariables) Variant ofMockMultipartHttpServletRequestBuilder(String, Object...)that also accepts anHttpMethod. -
MockMultipartHttpServletRequestBuilder
MockMultipartHttpServletRequestBuilder(URI uri) Variant ofMockMultipartHttpServletRequestBuilder(String, Object...)with aURI. -
MockMultipartHttpServletRequestBuilder
MockMultipartHttpServletRequestBuilder(cn.taketoday.http.HttpMethod httpMethod, URI uri)
-
-
方法详细资料
-
file
Add a newMockMultipartFilewith the given content.- 参数:
name- the name of the filecontent- the content of the file
-
file
Add the givenMockMultipartFile.- 参数:
file- the multipart file
-
part
AddPartcomponents to the request.- 参数:
parts- one or more parts to add
-
merge
从类复制的说明:MockHttpServletRequestBuilderMerges the properties of the "parent" RequestBuilder accepting values only if not already set in "this" instance.- 指定者:
merge在接口中cn.taketoday.beans.Mergeable- 覆盖:
merge在类中MockHttpServletRequestBuilder- 参数:
parent- the parentRequestBuilderto inherit properties from- 返回:
- the result of the merge
-
createServletRequest
protected final MockHttpServletRequest createServletRequest(jakarta.servlet.ServletContext servletContext) Create a newMockMultipartHttpServletRequestbased on the suppliedServletContextand theMockMultipartFilesadded to this builder. -
getCharsetOrDefault
-