diff --git a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/ByteBufferDecoderTests.java b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/ByteBufferDecoderTests.java index 6c59f5fb79..bf7ae3c86c 100644 --- a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/ByteBufferDecoderTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/ByteBufferDecoderTests.java @@ -23,7 +23,6 @@ import java.util.stream.StreamSupport; import org.junit.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; -import reactor.io.buffer.Buffer; import org.springframework.core.ResolvableType; import org.springframework.core.io.buffer.DataBuffer; diff --git a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/JacksonJsonDecoderTests.java b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/JacksonJsonDecoderTests.java index 83d7ac9e9a..ca01aa945f 100644 --- a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/JacksonJsonDecoderTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/JacksonJsonDecoderTests.java @@ -21,7 +21,6 @@ import java.util.stream.StreamSupport; import org.junit.Test; import reactor.core.publisher.Flux; -import reactor.io.buffer.Buffer; import org.springframework.core.ResolvableType; import org.springframework.core.io.buffer.DataBuffer; diff --git a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/Jaxb2DecoderTests.java b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/Jaxb2DecoderTests.java index eaf983e56e..5422869d81 100644 --- a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/Jaxb2DecoderTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/Jaxb2DecoderTests.java @@ -21,7 +21,6 @@ import java.util.stream.StreamSupport; import org.junit.Test; import reactor.core.publisher.Flux; -import reactor.io.buffer.Buffer; import org.springframework.core.ResolvableType; import org.springframework.core.io.buffer.DataBuffer; diff --git a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/StringDecoderTests.java b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/StringDecoderTests.java index 7b45773de8..937bdc8290 100644 --- a/spring-web-reactive/src/test/java/org/springframework/core/codec/support/StringDecoderTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/core/codec/support/StringDecoderTests.java @@ -24,7 +24,6 @@ import org.junit.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.converter.RxJava1SingleConverter; -import reactor.io.buffer.Buffer; import rx.Single; import org.springframework.core.ResolvableType; diff --git a/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/AsyncIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/AsyncIntegrationTests.java index 4d2fe6c94f..d499a43149 100644 --- a/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/AsyncIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/AsyncIntegrationTests.java @@ -28,7 +28,6 @@ import reactor.core.publisher.Mono; import reactor.core.publisher.ProcessorGroup; import reactor.core.publisher.Processors; import reactor.core.timer.Timers; -import reactor.io.buffer.Buffer; import reactor.rx.Stream; import org.springframework.core.io.buffer.DataBufferAllocator; @@ -98,7 +97,7 @@ public class AsyncIntegrationTests { public void basicTest() throws Exception { URI url = new URI("http://localhost:" + port); ResponseEntity response = new RestTemplate().exchange(RequestEntity.get(url) - .build(), String.class); + .build(), String.class); assertThat(response.getBody(), Matchers.equalTo("hello")); } @@ -107,14 +106,13 @@ public class AsyncIntegrationTests { @Override public Mono handle(ServerHttpRequest request, ServerHttpResponse response) { + DataBufferAllocator allocator = new DefaultDataBufferAllocator(); return response.setBody(Stream.just("h", "e", "l", "l", "o") .timer(Timers.global()) .throttleRequest(100) .dispatchOn(asyncGroup) - .collect(Buffer::new, Buffer::append) - .doOnSuccess(Buffer::flip) - .map((bytes) -> allocator.wrap(bytes.byteBuffer())) - ); + .collect(allocator::allocateBuffer, + (buffer, str) -> buffer.write(str.getBytes()))); } } diff --git a/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/XmlHandler.java b/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/XmlHandler.java index 7346fbc985..3b72aed9d9 100644 --- a/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/XmlHandler.java +++ b/spring-web-reactive/src/test/java/org/springframework/http/server/reactive/XmlHandler.java @@ -26,7 +26,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.io.buffer.Buffer; import org.springframework.core.io.buffer.DataBuffer; import org.springframework.core.io.buffer.DefaultDataBufferAllocator; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java index fd7745a2d1..5546b4cb61 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java @@ -25,7 +25,6 @@ import java.util.Map; import org.junit.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.io.buffer.Buffer; import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.io.buffer.DataBuffer; diff --git a/spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java index d9f1804147..84d3f55c34 100644 --- a/spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/web/reactive/method/annotation/RequestMappingIntegrationTests.java @@ -28,7 +28,6 @@ import org.junit.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.io.buffer.Buffer; import reactor.rx.Promise; import reactor.rx.Stream; import rx.Observable; @@ -443,12 +442,12 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati @RequestMapping("/raw-flux") public Flux rawFluxResponseBody() { - return Flux.just(Buffer.wrap("Hello!").byteBuffer()); + return Flux.just(ByteBuffer.wrap("Hello!".getBytes())); } @RequestMapping("/raw-observable") public Observable rawObservableResponseBody() { - return Observable.just(Buffer.wrap("Hello!").byteBuffer()); + return Observable.just(ByteBuffer.wrap("Hello!".getBytes())); } @RequestMapping("/mono")