Search in sources :

Example 1 with JmsHeaderMapper

use of org.springframework.integration.jms.JmsHeaderMapper in project spring-integration by spring-projects.

the class JmsOutboundChannelAdapterParserTests method adapterWithHeaderMapper.

@Test
public void adapterWithHeaderMapper() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithHeaderMapper.xml", this.getClass());
    EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("adapter");
    DirectFieldAccessor accessor = new DirectFieldAccessor(new DirectFieldAccessor(endpoint).getPropertyValue("handler"));
    JmsHeaderMapper headerMapper = (JmsHeaderMapper) accessor.getPropertyValue("headerMapper");
    assertNotNull(headerMapper);
    assertEquals(TestJmsHeaderMapper.class, headerMapper.getClass());
    context.close();
}
Also used : EventDrivenConsumer(org.springframework.integration.endpoint.EventDrivenConsumer) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) JmsHeaderMapper(org.springframework.integration.jms.JmsHeaderMapper) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 EventDrivenConsumer (org.springframework.integration.endpoint.EventDrivenConsumer)1 JmsHeaderMapper (org.springframework.integration.jms.JmsHeaderMapper)1