Update for Reactor API changes
This commit is contained in:
@@ -148,7 +148,8 @@ class RSocketBufferLeakTests {
|
||||
}
|
||||
|
||||
@Test // gh-24741
|
||||
@Disabled // pending https://github.com/rsocket/rsocket-java/pull/777
|
||||
@Disabled
|
||||
// pending https://github.com/rsocket/rsocket-java/pull/777
|
||||
void noSuchRouteOnChannelInteraction() {
|
||||
Flux<String> input = Flux.just("foo", "bar", "baz");
|
||||
Flux<String> result = requester.route("no-such-route").data(input).retrieveFlux(String.class);
|
||||
@@ -245,7 +246,7 @@ class RSocketBufferLeakTests {
|
||||
void checkForLeaks() {
|
||||
this.rsockets.stream().map(PayloadSavingDecorator::getPayloads)
|
||||
.forEach(payloadInfoProcessor -> {
|
||||
payloadInfoProcessor.complete();
|
||||
payloadInfoProcessor.emitComplete();
|
||||
payloadInfoProcessor.asFlux()
|
||||
.doOnNext(this::checkForLeak)
|
||||
.blockLast();
|
||||
@@ -290,18 +291,18 @@ class RSocketBufferLeakTests {
|
||||
|
||||
private final RSocket delegate;
|
||||
|
||||
private Sinks.StandaloneFluxSink<PayloadLeakInfo> payloads = Sinks.replayAll();
|
||||
private Sinks.Many<PayloadLeakInfo> payloads = Sinks.many().replay().all();
|
||||
|
||||
PayloadSavingDecorator(RSocket delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
Sinks.StandaloneFluxSink<PayloadLeakInfo> getPayloads() {
|
||||
Sinks.Many<PayloadLeakInfo> getPayloads() {
|
||||
return this.payloads;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
this.payloads = Sinks.replayAll();
|
||||
this.payloads = Sinks.many().replay().all();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -327,7 +328,7 @@ class RSocketBufferLeakTests {
|
||||
}
|
||||
|
||||
private io.rsocket.Payload addPayload(io.rsocket.Payload payload) {
|
||||
this.payloads.next(new PayloadLeakInfo(payload));
|
||||
this.payloads.emitNext(new PayloadLeakInfo(payload));
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
@@ -224,14 +224,14 @@ public class RSocketClientToServerIntegrationTests {
|
||||
@Controller
|
||||
static class ServerController {
|
||||
|
||||
final Sinks.StandaloneFluxSink<String> fireForgetPayloads = Sinks.replayAll();
|
||||
final Sinks.Many<String> fireForgetPayloads = Sinks.many().replay().all();
|
||||
|
||||
final Sinks.StandaloneFluxSink<String> metadataPushPayloads = Sinks.replayAll();
|
||||
final Sinks.Many<String> metadataPushPayloads = Sinks.many().replay().all();
|
||||
|
||||
|
||||
@MessageMapping("receive")
|
||||
void receive(String payload) {
|
||||
this.fireForgetPayloads.next(payload);
|
||||
this.fireForgetPayloads.emitNext(payload);
|
||||
}
|
||||
|
||||
@MessageMapping("echo")
|
||||
@@ -273,7 +273,7 @@ public class RSocketClientToServerIntegrationTests {
|
||||
|
||||
@ConnectMapping("foo-updates")
|
||||
public void handleMetadata(@Header("foo") String foo) {
|
||||
this.metadataPushPayloads.next(foo);
|
||||
this.metadataPushPayloads.emitNext(foo);
|
||||
}
|
||||
|
||||
@MessageExceptionHandler
|
||||
|
||||
@@ -217,11 +217,11 @@ public class RSocketServerToClientIntegrationTests {
|
||||
|
||||
private static class ClientHandler {
|
||||
|
||||
final Sinks.StandaloneFluxSink<String> fireForgetPayloads = Sinks.replayAll();
|
||||
final Sinks.Many<String> fireForgetPayloads = Sinks.many().replay().all();
|
||||
|
||||
@MessageMapping("receive")
|
||||
void receive(String payload) {
|
||||
this.fireForgetPayloads.next(payload);
|
||||
this.fireForgetPayloads.emitNext(payload);
|
||||
}
|
||||
|
||||
@MessageMapping("echo")
|
||||
|
||||
@@ -371,7 +371,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
this.messageHandler.handleMessage(message);
|
||||
|
||||
assertThat(controller.fluxSink).isNotNull();
|
||||
controller.fluxSink.next("foo");
|
||||
controller.fluxSink.emitNext("foo");
|
||||
|
||||
verify(this.converter, never()).toMessage(any(), any(MessageHeaders.class));
|
||||
}
|
||||
@@ -587,7 +587,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
|
||||
private MonoProcessor<String> monoProcessor;
|
||||
|
||||
private Sinks.StandaloneFluxSink<String> fluxSink;
|
||||
private Sinks.Many<String> fluxSink;
|
||||
|
||||
private boolean exceptionCaught = false;
|
||||
|
||||
@@ -599,7 +599,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
|
||||
@MessageMapping("flux")
|
||||
public Flux<String> handleFlux() {
|
||||
this.fluxSink = Sinks.unicast();
|
||||
this.fluxSink = Sinks.many().unicast().onBackpressureBuffer();
|
||||
return this.fluxSink.asFlux();
|
||||
}
|
||||
|
||||
|
||||
@@ -145,17 +145,17 @@ class RSocketClientToServerCoroutinesIntegrationTests {
|
||||
@Controller
|
||||
class ServerController {
|
||||
|
||||
val fireForgetPayloads = Sinks.replayAll<String>()
|
||||
val fireForgetPayloads = Sinks.many().replay().all<String>()
|
||||
|
||||
@MessageMapping("receive")
|
||||
fun receive(payload: String) {
|
||||
fireForgetPayloads.next(payload)
|
||||
fireForgetPayloads.emitNext(payload)
|
||||
}
|
||||
|
||||
@MessageMapping("receive-async")
|
||||
suspend fun receiveAsync(payload: String) {
|
||||
delay(10)
|
||||
fireForgetPayloads.next(payload)
|
||||
fireForgetPayloads.emitNext(payload)
|
||||
}
|
||||
|
||||
@MessageMapping("echo-async")
|
||||
|
||||
Reference in New Issue
Block a user