Search in sources :

Example 1 with StompSubProtocolErrorHandler

use of org.springframework.web.socket.messaging.StompSubProtocolErrorHandler in project spring-framework by spring-projects.

the class WebMvcStompEndpointRegistryTests method errorHandler.

@Test
public void errorHandler() throws Exception {
    StompSubProtocolErrorHandler errorHandler = mock(StompSubProtocolErrorHandler.class);
    this.endpointRegistry.setErrorHandler(errorHandler);
    this.endpointRegistry.addEndpoint("/stompOverWebSocket");
    Map<String, SubProtocolHandler> protocolHandlers = this.webSocketHandler.getProtocolHandlerMap();
    StompSubProtocolHandler stompHandler = (StompSubProtocolHandler) protocolHandlers.get("v12.stomp");
    assertSame(errorHandler, stompHandler.getErrorHandler());
}
Also used : StompSubProtocolHandler(org.springframework.web.socket.messaging.StompSubProtocolHandler) StompSubProtocolHandler(org.springframework.web.socket.messaging.StompSubProtocolHandler) SubProtocolHandler(org.springframework.web.socket.messaging.SubProtocolHandler) StompSubProtocolErrorHandler(org.springframework.web.socket.messaging.StompSubProtocolErrorHandler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StompSubProtocolErrorHandler (org.springframework.web.socket.messaging.StompSubProtocolErrorHandler)1 StompSubProtocolHandler (org.springframework.web.socket.messaging.StompSubProtocolHandler)1 SubProtocolHandler (org.springframework.web.socket.messaging.SubProtocolHandler)1