use of org.baeldung.websocket.client.MyStompSessionHandler in project tutorials by eugenp.
the class MyStompSessionHandlerIntegrationTest method givenValidSession_whenConnected_SendsMessage.
@Test
public void givenValidSession_whenConnected_SendsMessage() {
StompSession mockSession = Mockito.mock(StompSession.class);
StompHeaders mockHeader = Mockito.mock(StompHeaders.class);
MyStompSessionHandler sessionHandler = new MyStompSessionHandler();
sessionHandler.afterConnected(mockSession, mockHeader);
Mockito.verify(mockSession).subscribe("/topic/messages", sessionHandler);
Mockito.verify(mockSession).send(Mockito.anyString(), Mockito.anyObject());
}
Aggregations