Replace remaining use of block operator
This commit is contained in:
@@ -20,9 +20,9 @@ import java.net.URI;
|
||||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -103,12 +103,15 @@ public class MultipartIntegrationTests extends AbstractHttpHandlerIntegrationTes
|
||||
assertEquals("fooPart", part.name());
|
||||
assertTrue(part instanceof FilePart);
|
||||
assertEquals("foo.txt", ((FilePart) part).filename());
|
||||
DataBufferUtils.join(part.content()).subscribe(buffer -> {
|
||||
assertEquals(12, buffer.readableByteCount());
|
||||
byte[] byteContent = new byte[12];
|
||||
buffer.read(byteContent);
|
||||
assertEquals("Lorem Ipsum.", new String(byteContent));
|
||||
});
|
||||
|
||||
StepVerifier.create(DataBufferUtils.join(part.content()))
|
||||
.consumeNextWith(buffer -> {
|
||||
assertEquals(12, buffer.readableByteCount());
|
||||
byte[] byteContent = new byte[12];
|
||||
buffer.read(byteContent);
|
||||
assertEquals("Lorem Ipsum.", new String(byteContent));
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
private void assertBarPart(Part part) {
|
||||
|
||||
Reference in New Issue
Block a user