Search in sources :

Example 1 with ApplicationEventPublishingMessageHandler

use of org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler in project spring-integration by spring-projects.

the class EventOutboundChannelAdapterParserTests method validateEventParser.

@Test
public void validateEventParser() {
    EventDrivenConsumer adapter = this.context.getBean("eventAdapter", EventDrivenConsumer.class);
    Assert.assertNotNull(adapter);
    DirectFieldAccessor adapterAccessor = new DirectFieldAccessor(adapter);
    MessageHandler handler = (MessageHandler) adapterAccessor.getPropertyValue("handler");
    Assert.assertTrue(handler instanceof ApplicationEventPublishingMessageHandler);
    Assert.assertEquals(this.context.getBean("input"), adapterAccessor.getPropertyValue("inputChannel"));
    Assert.assertTrue(TestUtils.getPropertyValue(handler, "publishPayload", Boolean.class));
}
Also used : EventDrivenConsumer(org.springframework.integration.endpoint.EventDrivenConsumer) MessageHandler(org.springframework.messaging.MessageHandler) ApplicationEventPublishingMessageHandler(org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) ApplicationEventPublishingMessageHandler(org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 EventDrivenConsumer (org.springframework.integration.endpoint.EventDrivenConsumer)1 ApplicationEventPublishingMessageHandler (org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler)1 MessageHandler (org.springframework.messaging.MessageHandler)1