INT-1263, added more changes and tests related valdating MessageHistory in every module
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-event="http://www.springframework.org/schema/integration/event">
|
||||
|
||||
<int:message-history/>
|
||||
|
||||
<int-event:inbound-channel-adapter id="eventAdapterSimple" channel="input"/>
|
||||
|
||||
<int:channel id="input">
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.event.ApplicationEventInboundChannelAdapter;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -91,11 +92,13 @@ public class EventInboundChannelAdapterParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateUsage() {
|
||||
public void validateUsageWithHistory() {
|
||||
PollableChannel channel = context.getBean("input", PollableChannel.class);
|
||||
assertEquals(ContextRefreshedEvent.class, channel.receive(0).getPayload().getClass());
|
||||
context.publishEvent(new SampleEvent("hello"));
|
||||
Message<?> message = channel.receive(0);
|
||||
MessageHistory history = MessageHistory.read(message);
|
||||
assertTrue(history.containsComponent("eventAdapterSimple"));
|
||||
assertNotNull(message);
|
||||
assertEquals(SampleEvent.class, message.getPayload().getClass());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user