mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Add user to DISCONNECT in StompSubProtocolHandler
Issue: SPR-12215
This commit is contained in:
+5
-8
@@ -207,13 +207,7 @@ public class StompSubProtocolHandlerTests {
|
||||
@Test
|
||||
public void eventPublicationWithExceptions() {
|
||||
|
||||
ApplicationEventPublisher publisher = new ApplicationEventPublisher() {
|
||||
|
||||
@Override
|
||||
public void publishEvent(ApplicationEvent event) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
};
|
||||
ApplicationEventPublisher publisher = mock(ApplicationEventPublisher.class);
|
||||
|
||||
UserSessionRegistry registry = new DefaultUserSessionRegistry();
|
||||
this.protocolHandler.setUserSessionRegistry(registry);
|
||||
@@ -244,7 +238,10 @@ public class StompSubProtocolHandlerTests {
|
||||
verify(this.channel).send(this.messageCaptor.capture());
|
||||
actual = this.messageCaptor.getValue();
|
||||
assertNotNull(actual);
|
||||
assertEquals(StompCommand.DISCONNECT, StompHeaderAccessor.wrap(actual).getCommand());
|
||||
StompHeaderAccessor accessor = StompHeaderAccessor.wrap(actual);
|
||||
assertEquals(StompCommand.DISCONNECT, accessor.getCommand());
|
||||
assertEquals("s1", accessor.getSessionId());
|
||||
assertEquals("joe", accessor.getUser().getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user