use of jakarta.jms.Topic in project spring-framework by spring-projects.
the class DynamicDestinationResolverTests method resolveWithPubSubTopicSession.
@Test
public void resolveWithPubSubTopicSession() throws Exception {
Topic expectedDestination = new StubTopic();
TopicSession session = mock(TopicSession.class);
given(session.createTopic(DESTINATION_NAME)).willReturn(expectedDestination);
testResolveDestination(session, expectedDestination, true);
}
use of jakarta.jms.Topic in project spring-framework by spring-projects.
the class MessagingMessageListenerAdapterTests method replyPayloadToTopic.
@Test
public void replyPayloadToTopic() throws JMSException {
Session session = mock(Session.class);
Topic replyDestination = mock(Topic.class);
given(session.createTopic("topicOut")).willReturn(replyDestination);
MessageProducer messageProducer = mock(MessageProducer.class);
TextMessage responseMessage = mock(TextMessage.class);
given(session.createTextMessage("Response")).willReturn(responseMessage);
given(session.createProducer(replyDestination)).willReturn(messageProducer);
MessagingMessageListenerAdapter listener = getPayloadInstance("Response", "replyPayloadToTopic", Message.class);
listener.onMessage(mock(jakarta.jms.Message.class), session);
verify(session).createTopic("topicOut");
verify(session).createTextMessage("Response");
verify(messageProducer).send(responseMessage);
verify(messageProducer).close();
}
use of jakarta.jms.Topic in project spring-framework by spring-projects.
the class DynamicDestinationResolverTests method resolveWithPubSubVanillaSession.
@Test
public void resolveWithPubSubVanillaSession() throws Exception {
Topic expectedDestination = new StubTopic();
Session session = mock(Session.class);
given(session.createTopic(DESTINATION_NAME)).willReturn(expectedDestination);
testResolveDestination(session, expectedDestination, true);
}
Aggregations