Fix failing test
Explicitly pass the client-side JSR-356 WebSocketContainer to the TomcatWebSocketClient to prevent the ContainerProvider from finding the one from undertow-websockets-jsr through the ServiceLoader API.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.springframework.web.reactive.socket.client;
|
||||
|
||||
import javax.websocket.Session;
|
||||
import javax.websocket.WebSocketContainer;
|
||||
|
||||
import org.springframework.web.reactive.socket.HandshakeInfo;
|
||||
import org.springframework.web.reactive.socket.adapter.StandardWebSocketSession;
|
||||
@@ -33,6 +34,14 @@ import reactor.core.publisher.MonoProcessor;
|
||||
public class TomcatWebSocketClient extends StandardWebSocketClient {
|
||||
|
||||
|
||||
public TomcatWebSocketClient() {
|
||||
}
|
||||
|
||||
public TomcatWebSocketClient(WebSocketContainer webSocketContainer) {
|
||||
super(webSocketContainer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected StandardWebSocketSession createWebSocketSession(Session session,
|
||||
HandshakeInfo info, MonoProcessor<Void> completion) {
|
||||
|
||||
@@ -21,6 +21,8 @@ import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.apache.tomcat.websocket.WsContainerProvider;
|
||||
import org.apache.tomcat.websocket.WsWebSocketContainer;
|
||||
import org.apache.tomcat.websocket.server.WsContextListener;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -93,7 +95,7 @@ public abstract class AbstractWebSocketIntegrationTests {
|
||||
public static Object[][] arguments() throws IOException {
|
||||
|
||||
Flux<? extends WebSocketClient> clients = Flux.concat(
|
||||
Flux.just(new TomcatWebSocketClient()).repeat(5),
|
||||
Flux.just(new TomcatWebSocketClient(new WsWebSocketContainer())).repeat(5),
|
||||
Flux.just(new JettyWebSocketClient()).repeat(5),
|
||||
Flux.just(new ReactorNettyWebSocketClient()).repeat(5),
|
||||
Flux.just(new RxNettyWebSocketClient()).repeat(5),
|
||||
|
||||
Reference in New Issue
Block a user