update after Schedulers change

This commit is contained in:
Stephane Maldini 2016-05-31 11:11:38 +01:00
parent 3f80b4ab2e
commit 7fc3031c7a
1 changed files with 3 additions and 4 deletions

View File

@ -21,11 +21,10 @@ import java.time.Duration;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
import org.junit.Test; import org.junit.Test;
import reactor.core.publisher.Computations;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Timer; import reactor.core.scheduler.Schedulers;
import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.core.io.buffer.DataBufferFactory;
import org.springframework.core.io.buffer.DefaultDataBufferFactory; import org.springframework.core.io.buffer.DefaultDataBufferFactory;
@ -42,7 +41,7 @@ import static org.junit.Assert.assertThat;
*/ */
public class AsyncIntegrationTests extends AbstractHttpHandlerIntegrationTests { public class AsyncIntegrationTests extends AbstractHttpHandlerIntegrationTests {
private final Scheduler asyncGroup = Computations.parallel(); private final Scheduler asyncGroup = Schedulers.parallel();
private final DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory(); private final DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory();
@ -66,7 +65,7 @@ public class AsyncIntegrationTests extends AbstractHttpHandlerIntegrationTests {
@Override @Override
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) { public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
return response.writeWith(Flux.just("h", "e", "l", "l", "o") return response.writeWith(Flux.just("h", "e", "l", "l", "o")
.useTimer(Timer.global()) .useTimer(Schedulers.timer())
.delay(Duration.ofMillis(100)) .delay(Duration.ofMillis(100))
.publishOn(asyncGroup) .publishOn(asyncGroup)
.collect(dataBufferFactory::allocateBuffer, (buffer, str) -> buffer.write(str.getBytes()))); .collect(dataBufferFactory::allocateBuffer, (buffer, str) -> buffer.write(str.getBytes())));