Ensure filename is written
Now that SPR-16307 makes it possible to write a part with a Publisher we need to ensure we get the filename correctly when writing with Publisher<Resource>. Issue: SPR-16376
This commit is contained in:
@@ -170,9 +170,8 @@ public class MultipartHttpMessageWriterTests {
|
||||
|
||||
Part part = requestParts.getFirst("logo");
|
||||
assertEquals("logo", part.name());
|
||||
// TODO: a Resource written as an async part doesn't have a file name in the contentDisposition
|
||||
// assertTrue(part instanceof FilePart);
|
||||
// assertEquals("logo.jpg", ((FilePart) part).filename());
|
||||
assertTrue(part instanceof FilePart);
|
||||
assertEquals("logo.jpg", ((FilePart) part).filename());
|
||||
assertEquals(MediaType.IMAGE_JPEG, part.headers().getContentType());
|
||||
assertEquals(logo.getFile().length(), part.headers().getContentLength());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user