Browse Source

Fix failing tests from Reactor snapshot changes

See gh-25884
pull/25899/head
Rossen Stoyanchev 6 years ago
parent
commit
d49a7a105d
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/SyncInvocableHandlerMethod.java
  2. 8
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

2
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/SyncInvocableHandlerMethod.java

@ -102,7 +102,7 @@ public class SyncInvocableHandlerMethod extends HandlerMethod { @@ -102,7 +102,7 @@ public class SyncInvocableHandlerMethod extends HandlerMethod {
public HandlerResult invokeForHandlerResult(ServerWebExchange exchange,
BindingContext bindingContext, Object... providedArgs) {
MonoProcessor<HandlerResult> processor = MonoProcessor.fromSink(Sinks.one());
MonoProcessor<HandlerResult> processor = MonoProcessor.fromSink(Sinks.unsafe().one());
this.delegate.invoke(exchange, bindingContext, providedArgs).subscribeWith(processor);
if (processor.isTerminated()) {

8
spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

@ -99,7 +99,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -99,7 +99,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
String protocol = "echo-v1";
AtomicReference<HandshakeInfo> infoRef = new AtomicReference<>();
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one());
this.client.execute(getUrl("/sub-protocol"),
new WebSocketHandler() {
@ -132,7 +132,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -132,7 +132,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
HttpHeaders headers = new HttpHeaders();
headers.add("my-header", "my-value");
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one());
this.client.execute(getUrl("/custom-header"), headers,
session -> session.receive()
@ -148,7 +148,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -148,7 +148,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
void sessionClosing(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception {
startServer(client, server, serverConfigClass);
MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.fromSink(Sinks.one());
MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.fromSink(Sinks.unsafe().one());
this.client.execute(getUrl("/close"),
session -> {
logger.debug("Starting..");
@ -169,7 +169,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -169,7 +169,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
void cookie(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception {
startServer(client, server, serverConfigClass);
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one());
AtomicReference<String> cookie = new AtomicReference<>();
this.client.execute(getUrl("/cookie"),
session -> {

Loading…
Cancel
Save