@Before public void setup() { SubscribableChannel inChannel = mock(SubscribableChannel.class); SubscribableChannel outChannel = mock(SubscribableChannel.class); this.webSocketHandler = new SubProtocolWebSocketHandler(inChannel, outChannel); WebSocketTransportRegistration transport = new WebSocketTransportRegistration(); TaskScheduler scheduler = mock(TaskScheduler.class); this.endpointRegistry = new WebMvcStompEndpointRegistry(this.webSocketHandler, transport, scheduler); }
@Bean public HandlerMapping stompWebSocketHandlerMapping() { WebSocketHandler handler = decorateWebSocketHandler(subProtocolWebSocketHandler()); WebMvcStompEndpointRegistry registry = new WebMvcStompEndpointRegistry( handler, getTransportRegistration(), messageBrokerTaskScheduler()); ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { registry.setApplicationContext(applicationContext); } registerStompEndpoints(registry); return registry.getHandlerMapping(); }
@Bean public HandlerMapping stompWebSocketHandlerMapping() { WebSocketHandler handler = decorateWebSocketHandler(subProtocolWebSocketHandler()); WebMvcStompEndpointRegistry registry = new WebMvcStompEndpointRegistry( handler, getTransportRegistration(), messageBrokerTaskScheduler()); ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { registry.setApplicationContext(applicationContext); } registerStompEndpoints(registry); return registry.getHandlerMapping(); }
@Bean public HandlerMapping stompWebSocketHandlerMapping() { WebSocketHandler handler = decorateWebSocketHandler(subProtocolWebSocketHandler()); WebMvcStompEndpointRegistry registry = new WebMvcStompEndpointRegistry( handler, getTransportRegistration(), messageBrokerTaskScheduler()); ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { registry.setApplicationContext(applicationContext); } registerStompEndpoints(registry); return registry.getHandlerMapping(); }