INT-1263, added more changes and tests related valdating MessageHistory in every module
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.integration.xml.transformer;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,12 +27,14 @@ import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
@@ -56,7 +60,10 @@ public class XsltTransformerTests {
|
||||
input.send(message);
|
||||
Message<?> resultMessage = output.receive();
|
||||
MessageHistory history = MessageHistory.read(resultMessage);
|
||||
assertTrue(history.containsComponent("paramHeadersWithStartWildCharacter"));
|
||||
assertNotNull(history);
|
||||
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "paramHeadersWithStartWildCharacter", 0);
|
||||
assertNotNull(componentHistoryRecord);
|
||||
assertEquals("xml:xslt-transformer", componentHistoryRecord.get("type"));
|
||||
assertEquals("Wrong payload type",String.class, resultMessage.getPayload().getClass());
|
||||
assertTrue(((String) resultMessage.getPayload()).contains("testParamValue"));
|
||||
assertFalse(((String) resultMessage.getPayload()).contains("FOO"));
|
||||
|
||||
Reference in New Issue
Block a user