Fix STOMP integration test to close stompClient
The `ReactorNettyTcpStompClient` is based on the `ReactorNettyTcpClient` which uses a `Schedulers.newParallel()` which has to be shut downed in the end * Migrate all the STOMP tests to JUnit 5
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2019 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -22,7 +22,7 @@ import static org.mockito.Mockito.mock;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.messaging.simp.stomp.StompClientSupport;
|
import org.springframework.messaging.simp.stomp.StompClientSupport;
|
||||||
import org.springframework.messaging.simp.stomp.StompHeaders;
|
import org.springframework.messaging.simp.stomp.StompHeaders;
|
||||||
@@ -35,6 +35,7 @@ import org.springframework.util.concurrent.SettableListenableFuture;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Artem Bilan
|
* @author Artem Bilan
|
||||||
|
*
|
||||||
* @since 4.2.9
|
* @since 4.2.9
|
||||||
*/
|
*/
|
||||||
public class StompSessionManagerTests {
|
public class StompSessionManagerTests {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2019 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,13 +17,12 @@
|
|||||||
package org.springframework.integration.stomp.client;
|
package org.springframework.integration.stomp.client;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.assertj.core.api.Assertions.fail;
|
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||||
|
|
||||||
import org.apache.activemq.broker.BrokerService;
|
import org.apache.activemq.broker.BrokerService;
|
||||||
import org.junit.AfterClass;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.Rule;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import org.springframework.context.ApplicationEvent;
|
import org.springframework.context.ApplicationEvent;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
@@ -46,7 +45,6 @@ import org.springframework.integration.stomp.event.StompSessionConnectedEvent;
|
|||||||
import org.springframework.integration.stomp.inbound.StompInboundChannelAdapter;
|
import org.springframework.integration.stomp.inbound.StompInboundChannelAdapter;
|
||||||
import org.springframework.integration.stomp.outbound.StompMessageHandler;
|
import org.springframework.integration.stomp.outbound.StompMessageHandler;
|
||||||
import org.springframework.integration.support.converter.PassThruMessageConverter;
|
import org.springframework.integration.support.converter.PassThruMessageConverter;
|
||||||
import org.springframework.integration.test.rule.Log4j2LevelAdjuster;
|
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
import org.springframework.messaging.MessageChannel;
|
import org.springframework.messaging.MessageChannel;
|
||||||
import org.springframework.messaging.MessageDeliveryException;
|
import org.springframework.messaging.MessageDeliveryException;
|
||||||
@@ -70,15 +68,7 @@ public class StompServerIntegrationTests {
|
|||||||
|
|
||||||
private static ReactorNettyTcpStompClient stompClient;
|
private static ReactorNettyTcpStompClient stompClient;
|
||||||
|
|
||||||
@Rule
|
@BeforeAll
|
||||||
public Log4j2LevelAdjuster adjuster =
|
|
||||||
Log4j2LevelAdjuster.trace()
|
|
||||||
.categories(true, "org.springframework",
|
|
||||||
"org.apache.activemq.broker",
|
|
||||||
"reactor.ipc",
|
|
||||||
"io.netty");
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setup() throws Exception {
|
public static void setup() throws Exception {
|
||||||
int port = SocketUtils.findAvailableTcpPort(61613);
|
int port = SocketUtils.findAvailableTcpPort(61613);
|
||||||
activeMQBroker = new BrokerService();
|
activeMQBroker = new BrokerService();
|
||||||
@@ -97,8 +87,9 @@ public class StompServerIntegrationTests {
|
|||||||
stompClient.setReceiptTimeLimit(5000);
|
stompClient.setReceiptTimeLimit(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterAll
|
||||||
public static void teardown() throws Exception {
|
public static void teardown() throws Exception {
|
||||||
|
stompClient.shutdown();
|
||||||
activeMQBroker.stop();
|
activeMQBroker.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +133,7 @@ public class StompServerIntegrationTests {
|
|||||||
assertThat(stompReceiptEvent.getStompCommand()).isEqualTo(StompCommand.SUBSCRIBE);
|
assertThat(stompReceiptEvent.getStompCommand()).isEqualTo(StompCommand.SUBSCRIBE);
|
||||||
assertThat(stompReceiptEvent.getDestination()).isEqualTo("/topic/myTopic");
|
assertThat(stompReceiptEvent.getDestination()).isEqualTo("/topic/myTopic");
|
||||||
|
|
||||||
stompOutputChannel1.send(new GenericMessage<byte[]>("Hello, Client#2!".getBytes()));
|
stompOutputChannel1.send(new GenericMessage<>("Hello, Client#2!".getBytes()));
|
||||||
|
|
||||||
Message<?> receive11 = stompInputChannel1.receive(10000);
|
Message<?> receive11 = stompInputChannel1.receive(10000);
|
||||||
Message<?> receive21 = stompInputChannel2.receive(10000);
|
Message<?> receive21 = stompInputChannel2.receive(10000);
|
||||||
@@ -153,7 +144,7 @@ public class StompServerIntegrationTests {
|
|||||||
assertThat((byte[]) receive11.getPayload()).isEqualTo("Hello, Client#2!".getBytes());
|
assertThat((byte[]) receive11.getPayload()).isEqualTo("Hello, Client#2!".getBytes());
|
||||||
assertThat((byte[]) receive21.getPayload()).isEqualTo("Hello, Client#2!".getBytes());
|
assertThat((byte[]) receive21.getPayload()).isEqualTo("Hello, Client#2!".getBytes());
|
||||||
|
|
||||||
stompOutputChannel2.send(new GenericMessage<byte[]>("Hello, Client#1!".getBytes()));
|
stompOutputChannel2.send(new GenericMessage<>("Hello, Client#1!".getBytes()));
|
||||||
|
|
||||||
Message<?> receive12 = stompInputChannel1.receive(10000);
|
Message<?> receive12 = stompInputChannel1.receive(10000);
|
||||||
Message<?> receive22 = stompInputChannel2.receive(10000);
|
Message<?> receive22 = stompInputChannel2.receive(10000);
|
||||||
@@ -175,7 +166,7 @@ public class StompServerIntegrationTests {
|
|||||||
Lifecycle stompInboundChannelAdapter2 = context2.getBean("stompInboundChannelAdapter", Lifecycle.class);
|
Lifecycle stompInboundChannelAdapter2 = context2.getBean("stompInboundChannelAdapter", Lifecycle.class);
|
||||||
stompInboundChannelAdapter2.stop();
|
stompInboundChannelAdapter2.stop();
|
||||||
|
|
||||||
stompOutputChannel1.send(new GenericMessage<byte[]>("How do you do?".getBytes()));
|
stompOutputChannel1.send(new GenericMessage<>("How do you do?".getBytes()));
|
||||||
|
|
||||||
Message<?> receive13 = stompInputChannel1.receive(10000);
|
Message<?> receive13 = stompInputChannel1.receive(10000);
|
||||||
assertThat(receive13).isNotNull();
|
assertThat(receive13).isNotNull();
|
||||||
@@ -192,7 +183,7 @@ public class StompServerIntegrationTests {
|
|||||||
assertThat(stompReceiptEvent.getStompCommand()).isEqualTo(StompCommand.SUBSCRIBE);
|
assertThat(stompReceiptEvent.getStompCommand()).isEqualTo(StompCommand.SUBSCRIBE);
|
||||||
assertThat(stompReceiptEvent.getDestination()).isEqualTo("/topic/myTopic");
|
assertThat(stompReceiptEvent.getDestination()).isEqualTo("/topic/myTopic");
|
||||||
|
|
||||||
stompOutputChannel1.send(new GenericMessage<byte[]>("???".getBytes()));
|
stompOutputChannel1.send(new GenericMessage<>("???".getBytes()));
|
||||||
|
|
||||||
Message<?> receive24 = stompInputChannel2.receive(10000);
|
Message<?> receive24 = stompInputChannel2.receive(10000);
|
||||||
assertThat(receive24).isNotNull();
|
assertThat(receive24).isNotNull();
|
||||||
@@ -206,14 +197,10 @@ public class StompServerIntegrationTests {
|
|||||||
}
|
}
|
||||||
while (!(eventMessage.getPayload() instanceof StompConnectionFailedEvent));
|
while (!(eventMessage.getPayload() instanceof StompConnectionFailedEvent));
|
||||||
|
|
||||||
try {
|
|
||||||
stompOutputChannel1.send(new GenericMessage<byte[]>("foo".getBytes()));
|
assertThatExceptionOfType(MessageDeliveryException.class)
|
||||||
fail("MessageDeliveryException is expected");
|
.isThrownBy(() -> stompOutputChannel1.send(new GenericMessage<>("foo".getBytes())))
|
||||||
}
|
.withMessageContaining("could not deliver message");
|
||||||
catch (Exception e) {
|
|
||||||
assertThat(e).isInstanceOf(MessageDeliveryException.class);
|
|
||||||
assertThat(e.getMessage()).contains("could not deliver message");
|
|
||||||
}
|
|
||||||
|
|
||||||
activeMQBroker.start(false);
|
activeMQBroker.start(false);
|
||||||
|
|
||||||
@@ -229,7 +216,7 @@ public class StompServerIntegrationTests {
|
|||||||
}
|
}
|
||||||
while (!(eventMessage.getPayload() instanceof StompReceiptEvent));
|
while (!(eventMessage.getPayload() instanceof StompReceiptEvent));
|
||||||
|
|
||||||
stompOutputChannel1.send(new GenericMessage<byte[]>("foo".getBytes()));
|
stompOutputChannel1.send(new GenericMessage<>("foo".getBytes()));
|
||||||
Message<?> receive25 = stompInputChannel2.receive(10000);
|
Message<?> receive25 = stompInputChannel2.receive(10000);
|
||||||
assertThat(receive25).isNotNull();
|
assertThat(receive25).isNotNull();
|
||||||
assertThat((byte[]) receive25.getPayload()).isEqualTo("foo".getBytes());
|
assertThat((byte[]) receive25.getPayload()).isEqualTo("foo".getBytes());
|
||||||
@@ -278,7 +265,6 @@ public class StompServerIntegrationTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public ApplicationListener<ApplicationEvent> stompEventListener() {
|
public ApplicationListener<ApplicationEvent> stompEventListener() {
|
||||||
ApplicationEventListeningMessageProducer producer = new ApplicationEventListeningMessageProducer();
|
ApplicationEventListeningMessageProducer producer = new ApplicationEventListeningMessageProducer();
|
||||||
producer.setEventTypes(StompIntegrationEvent.class);
|
producer.setEventTypes(StompIntegrationEvent.class);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2019 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -21,8 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
@@ -36,16 +35,15 @@ import org.springframework.integration.test.util.TestUtils;
|
|||||||
import org.springframework.messaging.MessageChannel;
|
import org.springframework.messaging.MessageChannel;
|
||||||
import org.springframework.messaging.MessageHandler;
|
import org.springframework.messaging.MessageHandler;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Artem Bilan
|
* @author Artem Bilan
|
||||||
|
*
|
||||||
* @since 4.2
|
* @since 4.2
|
||||||
*/
|
*/
|
||||||
@ContextConfiguration
|
@SpringJUnitConfig
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@DirtiesContext
|
@DirtiesContext
|
||||||
public class StompAdaptersParserTests {
|
public class StompAdaptersParserTests {
|
||||||
|
|
||||||
@@ -64,6 +62,7 @@ public class StompAdaptersParserTests {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MessageChannel inboundChannel;
|
private MessageChannel inboundChannel;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("defaultInboundAdapter.adapter")
|
@Qualifier("defaultInboundAdapter.adapter")
|
||||||
private StompInboundChannelAdapter defaultInboundAdapter;
|
private StompInboundChannelAdapter defaultInboundAdapter;
|
||||||
@@ -122,7 +121,7 @@ public class StompAdaptersParserTests {
|
|||||||
assertThat(headerMapper).isNotNull();
|
assertThat(headerMapper).isNotNull();
|
||||||
assertThat(headerMapper).isNotSameAs(this.headerMapper);
|
assertThat(headerMapper).isNotSameAs(this.headerMapper);
|
||||||
assertThat(TestUtils.getPropertyValue(headerMapper, "inboundHeaderNames", String[].class))
|
assertThat(TestUtils.getPropertyValue(headerMapper, "inboundHeaderNames", String[].class))
|
||||||
.isEqualTo(new String[] { "bar", "foo" });
|
.isEqualTo(new String[]{"bar", "foo"});
|
||||||
assertThat(TestUtils.getPropertyValue(this.customInboundAdapter, "payloadType", Class.class))
|
assertThat(TestUtils.getPropertyValue(this.customInboundAdapter, "payloadType", Class.class))
|
||||||
.isEqualTo(Integer.class);
|
.isEqualTo(Integer.class);
|
||||||
assertThat(TestUtils.getPropertyValue(this.customInboundAdapter, "autoStartup", Boolean.class)).isFalse();
|
assertThat(TestUtils.getPropertyValue(this.customInboundAdapter, "autoStartup", Boolean.class)).isFalse();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2019 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -21,9 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.Rule;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
@@ -45,7 +43,6 @@ import org.springframework.integration.stomp.event.StompConnectionFailedEvent;
|
|||||||
import org.springframework.integration.stomp.event.StompIntegrationEvent;
|
import org.springframework.integration.stomp.event.StompIntegrationEvent;
|
||||||
import org.springframework.integration.stomp.event.StompReceiptEvent;
|
import org.springframework.integration.stomp.event.StompReceiptEvent;
|
||||||
import org.springframework.integration.stomp.event.StompSessionConnectedEvent;
|
import org.springframework.integration.stomp.event.StompSessionConnectedEvent;
|
||||||
import org.springframework.integration.test.rule.Log4j2LevelAdjuster;
|
|
||||||
import org.springframework.integration.websocket.TomcatWebSocketTestServer;
|
import org.springframework.integration.websocket.TomcatWebSocketTestServer;
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
import org.springframework.messaging.MessageHandlingException;
|
import org.springframework.messaging.MessageHandlingException;
|
||||||
@@ -65,7 +62,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
|||||||
import org.springframework.scheduling.TaskScheduler;
|
import org.springframework.scheduling.TaskScheduler;
|
||||||
import org.springframework.test.annotation.DirtiesContext;
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.web.socket.WebSocketHandler;
|
import org.springframework.web.socket.WebSocketHandler;
|
||||||
import org.springframework.web.socket.WebSocketHttpHeaders;
|
import org.springframework.web.socket.WebSocketHttpHeaders;
|
||||||
@@ -80,7 +77,6 @@ import org.springframework.web.socket.server.HandshakeInterceptor;
|
|||||||
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
|
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
|
||||||
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
|
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
|
||||||
import org.springframework.web.socket.sockjs.client.SockJsClient;
|
import org.springframework.web.socket.sockjs.client.SockJsClient;
|
||||||
import org.springframework.web.socket.sockjs.client.Transport;
|
|
||||||
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,15 +85,10 @@ import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
|||||||
* @since 4.2
|
* @since 4.2
|
||||||
*/
|
*/
|
||||||
@ContextConfiguration(classes = StompInboundChannelAdapterWebSocketIntegrationTests.ContextConfiguration.class)
|
@ContextConfiguration(classes = StompInboundChannelAdapterWebSocketIntegrationTests.ContextConfiguration.class)
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@SpringJUnitConfig
|
||||||
@DirtiesContext
|
@DirtiesContext
|
||||||
public class StompInboundChannelAdapterWebSocketIntegrationTests {
|
public class StompInboundChannelAdapterWebSocketIntegrationTests {
|
||||||
|
|
||||||
@Rule
|
|
||||||
public Log4j2LevelAdjuster adjuster =
|
|
||||||
Log4j2LevelAdjuster.trace()
|
|
||||||
.categories("org.springframework", "org.springframework.integration.stomp");
|
|
||||||
|
|
||||||
@Value("#{server.serverContext}")
|
@Value("#{server.serverContext}")
|
||||||
private ConfigurableApplicationContext serverContext;
|
private ConfigurableApplicationContext serverContext;
|
||||||
|
|
||||||
@@ -252,7 +243,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public WebSocketClient webSocketClient() {
|
public WebSocketClient webSocketClient() {
|
||||||
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
|
return new SockJsClient(Collections.singletonList(new WebSocketTransport(new StandardWebSocketClient())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@@ -273,7 +264,7 @@ public class StompInboundChannelAdapterWebSocketIntegrationTests {
|
|||||||
handshakeHeaders.setOrigin("https://www.example.com/");
|
handshakeHeaders.setOrigin("https://www.example.com/");
|
||||||
webSocketStompSessionManager.setHandshakeHeaders(handshakeHeaders);
|
webSocketStompSessionManager.setHandshakeHeaders(handshakeHeaders);
|
||||||
StompHeaders stompHeaders = new StompHeaders();
|
StompHeaders stompHeaders = new StompHeaders();
|
||||||
stompHeaders.setHeartbeat(new long[] { 10000, 10000 });
|
stompHeaders.setHeartbeat(new long[]{10000, 10000});
|
||||||
webSocketStompSessionManager.setConnectHeaders(stompHeaders);
|
webSocketStompSessionManager.setConnectHeaders(stompHeaders);
|
||||||
return webSocketStompSessionManager;
|
return webSocketStompSessionManager;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2019 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -77,7 +77,6 @@ import org.springframework.web.socket.messaging.WebSocketStompClient;
|
|||||||
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
|
import org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy;
|
||||||
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
|
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
|
||||||
import org.springframework.web.socket.sockjs.client.SockJsClient;
|
import org.springframework.web.socket.sockjs.client.SockJsClient;
|
||||||
import org.springframework.web.socket.sockjs.client.Transport;
|
|
||||||
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,7 +170,7 @@ public class StompMessageHandlerWebSocketIntegrationTests {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public WebSocketClient webSocketClient() {
|
public WebSocketClient webSocketClient() {
|
||||||
return new SockJsClient(Collections.<Transport>singletonList(new WebSocketTransport(new StandardWebSocketClient())));
|
return new SockJsClient(Collections.singletonList(new WebSocketTransport(new StandardWebSocketClient())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@@ -217,7 +216,7 @@ public class StompMessageHandlerWebSocketIntegrationTests {
|
|||||||
|
|
||||||
// WebSocket Server part
|
// WebSocket Server part
|
||||||
|
|
||||||
@Target({ ElementType.TYPE })
|
@Target({ElementType.TYPE})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Controller
|
@Controller
|
||||||
private @interface IntegrationTestController {
|
private @interface IntegrationTestController {
|
||||||
|
|||||||
Reference in New Issue
Block a user