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:
Rossen Stoyanchev
2018-01-19 22:12:53 -05:00
parent aea6bb6357
commit 283811b16b
2 changed files with 13 additions and 5 deletions

View File

@@ -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());
}