use of jakarta.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method receiveDefaultDestination.
@Test
public void receiveDefaultDestination() {
Destination destination = new Destination() {
};
this.messagingTemplate.setDefaultDestination(destination);
jakarta.jms.Message jmsMessage = createJmsTextMessage();
given(this.jmsTemplate.receive(destination)).willReturn(jmsMessage);
Message<?> message = this.messagingTemplate.receive();
verify(this.jmsTemplate).receive(destination);
assertTextMessage(message);
}
use of jakarta.jms.Destination in project spring-framework by spring-projects.
the class JmsMessagingTemplateTests method send.
@Test
public void send() {
Destination destination = new Destination() {
};
Message<String> message = createTextMessage();
this.messagingTemplate.send(destination, message);
verify(this.jmsTemplate).send(eq(destination), this.messageCreator.capture());
assertTextMessage(this.messageCreator.getValue());
}
use of jakarta.jms.Destination in project spring-framework by spring-projects.
the class DefaultJmsActivationSpecFactoryTests method webSphereResourceAdapterSetup.
@Test
public void webSphereResourceAdapterSetup() throws Exception {
Destination destination = new StubQueue();
DestinationResolver destinationResolver = mock(DestinationResolver.class);
given(destinationResolver.resolveDestinationName(null, "destinationname", false)).willReturn(destination);
DefaultJmsActivationSpecFactory activationSpecFactory = new DefaultJmsActivationSpecFactory();
activationSpecFactory.setDestinationResolver(destinationResolver);
StubWebSphereActivationSpecImpl spec = (StubWebSphereActivationSpecImpl) activationSpecFactory.createActivationSpec(new StubWebSphereResourceAdapterImpl(), activationSpecConfig);
assertThat(spec.getDestination()).isEqualTo(destination);
assertThat(spec.getMaxConcurrency()).isEqualTo(5);
assertThat(spec.getMaxBatchSize()).isEqualTo(3);
}
use of jakarta.jms.Destination in project spring-framework by spring-projects.
the class SimpleJmsHeaderMapperTests method jmsReplyToMappedToHeader.
@Test
public void jmsReplyToMappedToHeader() throws JMSException {
Destination replyTo = new Destination() {
};
jakarta.jms.Message jmsMessage = new StubTextMessage();
jmsMessage.setJMSReplyTo(replyTo);
assertInboundHeader(jmsMessage, JmsHeaders.REPLY_TO, replyTo);
}
use of jakarta.jms.Destination in project spring-framework by spring-projects.
the class SimpleJmsHeaderMapperTests method destinationMappedToHeader.
@Test
public void destinationMappedToHeader() throws JMSException {
Destination destination = new Destination() {
};
jakarta.jms.Message jmsMessage = new StubTextMessage();
jmsMessage.setJMSDestination(destination);
assertInboundHeader(jmsMessage, JmsHeaders.DESTINATION, destination);
}
Aggregations