Search in sources :

Example 41 with Destination

use of jakarta.jms.Destination in project spring-framework by spring-projects.

the class SimpleJmsHeaderMapperTests method userDefinedPropertyWithUnsupportedType.

@Test
public void userDefinedPropertyWithUnsupportedType() throws JMSException {
    Destination destination = new Destination() {
    };
    Message<String> message = initBuilder().setHeader("destination", destination).build();
    jakarta.jms.Message jmsMessage = new StubTextMessage();
    mapper.fromHeaders(message.getHeaders(), jmsMessage);
    Object value = jmsMessage.getObjectProperty("destination");
    assertThat(value).isNull();
}
Also used : Destination(jakarta.jms.Destination) StubTextMessage(org.springframework.jms.StubTextMessage) Test(org.junit.jupiter.api.Test)

Aggregations

Destination (jakarta.jms.Destination)41 Test (org.junit.jupiter.api.Test)31 StubTextMessage (org.springframework.jms.StubTextMessage)11 Session (jakarta.jms.Session)8 TextMessage (jakarta.jms.TextMessage)5 JMSException (jakarta.jms.JMSException)3 HashMap (java.util.HashMap)3 DestinationResolutionException (org.springframework.jms.support.destination.DestinationResolutionException)3 DestinationResolver (org.springframework.jms.support.destination.DestinationResolver)3 MessageProducer (jakarta.jms.MessageProducer)2 QueueSender (jakarta.jms.QueueSender)2 NamingException (javax.naming.NamingException)2 StubQueue (org.springframework.jms.StubQueue)2 Connection (jakarta.jms.Connection)1 ConnectionFactory (jakarta.jms.ConnectionFactory)1 Message (jakarta.jms.Message)1 MessageConsumer (jakarta.jms.MessageConsumer)1 Map (java.util.Map)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 JmsTemplate (org.springframework.jms.core.JmsTemplate)1