Class MockPart
java.lang.Object
org.springframework.mock.web.MockPart
- All Implemented Interfaces:
jakarta.servlet.http.Part
Mock implementation of
jakarta.servlet.http.Part
.- Since:
- 4.3.12
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a part with a name and content only.Constructor for a part with a name, filename, and content.MockPart
(String name, @Nullable String filename, byte @Nullable [] content, @Nullable MediaType contentType) Constructor for a part with a name, filename, content, and content type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
final HttpHeaders
Return theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.getHeaders
(String name) getName()
long
getSize()
void
-
Constructor Details
-
MockPart
-
MockPart
-
MockPart
-
-
Method Details
-
getName
- Specified by:
getName
in interfacejakarta.servlet.http.Part
-
getSubmittedFileName
-
getContentType
-
getSize
public long getSize()- Specified by:
getSize
in interfacejakarta.servlet.http.Part
-
getInputStream
- Specified by:
getInputStream
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
write
- Specified by:
write
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
delete
- Specified by:
delete
in interfacejakarta.servlet.http.Part
- Throws:
IOException
-
getHeader
-
getHeaders
- Specified by:
getHeaders
in interfacejakarta.servlet.http.Part
-
getHeaderNames
- Specified by:
getHeaderNames
in interfacejakarta.servlet.http.Part
-
getHeaders
Return theHttpHeaders
backing header related accessor methods, allowing for populating selected header entries.
-