Use DataBufferUtils.compose and remove writeAggregator

Use DataBufferUtils.compose instead of writeAggregator to combine
multiple data buffers into one, as the write aggregator would not work
when the initial data buffer did not have enough capacity to contain
all subsequent buffers.

Removed writeAggregator, as it is no longer needed.

Issue: SPR-16365
This commit is contained in:
Arjen Poutsma
2018-01-12 10:35:34 +01:00
parent 384a399fd2
commit 67e7c784e8
12 changed files with 20 additions and 50 deletions

View File

@@ -89,7 +89,7 @@ public class SynchronossPartHttpMessageReaderTests {
assertTrue(part instanceof FilePart);
assertEquals("fooPart", part.name());
assertEquals("foo.txt", ((FilePart) part).filename());
DataBuffer buffer = part.content().reduce(DataBufferUtils.writeAggregator()).block();
DataBuffer buffer = DataBufferUtils.compose(part.content()).block();
assertEquals(12, buffer.readableByteCount());
byte[] byteContent = new byte[12];
buffer.read(byteContent);

View File

@@ -103,10 +103,7 @@ public class MultipartIntegrationTests extends AbstractHttpHandlerIntegrationTes
assertEquals("fooPart", part.name());
assertTrue(part instanceof FilePart);
assertEquals("foo.txt", ((FilePart) part).filename());
DataBuffer buffer = part
.content()
.reduce(DataBufferUtils.writeAggregator())
.block();
DataBuffer buffer = DataBufferUtils.compose(part.content()).block();
assertEquals(12, buffer.readableByteCount());
byte[] byteContent = new byte[12];
buffer.read(byteContent);