|
|
|
@ -106,7 +106,7 @@ public class SockJsSessionTests extends AbstractSockJsSessionTests<TestSockJsSes |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void delegateMessagesWithErrorAndConnectionClosing() throws Exception { |
|
|
|
public void delegateMessagesWithError() throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
TestSockJsSession session = new TestSockJsSession("1", this.sockJsConfig, |
|
|
|
TestSockJsSession session = new TestSockJsSession("1", this.sockJsConfig, |
|
|
|
new ExceptionWebSocketHandlerDecorator(this.webSocketHandler), Collections.emptyMap()); |
|
|
|
new ExceptionWebSocketHandlerDecorator(this.webSocketHandler), Collections.emptyMap()); |
|
|
|
@ -130,6 +130,23 @@ public class SockJsSessionTests extends AbstractSockJsSessionTests<TestSockJsSes |
|
|
|
verifyNoMoreInteractions(this.webSocketHandler); |
|
|
|
verifyNoMoreInteractions(this.webSocketHandler); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test // gh-23828
|
|
|
|
|
|
|
|
public void delegateMessagesEmptyAfterConnectionClosed() throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TestSockJsSession session = new TestSockJsSession("1", this.sockJsConfig, |
|
|
|
|
|
|
|
new ExceptionWebSocketHandlerDecorator(this.webSocketHandler), Collections.emptyMap()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
session.delegateConnectionEstablished(); |
|
|
|
|
|
|
|
session.close(CloseStatus.NORMAL); |
|
|
|
|
|
|
|
session.delegateMessages("", " ", "\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// No exception for empty messages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verify(this.webSocketHandler).afterConnectionEstablished(session); |
|
|
|
|
|
|
|
verify(this.webSocketHandler).afterConnectionClosed(session, CloseStatus.NORMAL); |
|
|
|
|
|
|
|
verifyNoMoreInteractions(this.webSocketHandler); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void delegateConnectionClosed() throws Exception { |
|
|
|
public void delegateConnectionClosed() throws Exception { |
|
|
|
this.session.delegateConnectionEstablished(); |
|
|
|
this.session.delegateConnectionEstablished(); |
|
|
|
|