Search in sources :

Example 1 with StubStringResult

use of org.springframework.integration.xml.config.StubResultFactory.StubStringResult in project spring-integration by spring-projects.

the class XsltPayloadTransformerParserTests method testWithResourceProvidedAndStubResultFactory.

@Test
public void testWithResourceProvidedAndStubResultFactory() throws Exception {
    MessageChannel input = (MessageChannel) applicationContext.getBean("withTemplatesAndResultFactoryIn");
    GenericMessage<Object> message = new GenericMessage<Object>(XmlTestUtil.getDomSourceForString(doc));
    input.send(message);
    Message<?> result = output.receive(0);
    assertTrue("Payload was not a StubStringResult", result.getPayload() instanceof StubStringResult);
}
Also used : GenericMessage(org.springframework.messaging.support.GenericMessage) MessageChannel(org.springframework.messaging.MessageChannel) StubStringResult(org.springframework.integration.xml.config.StubResultFactory.StubStringResult) Test(org.junit.Test)

Example 2 with StubStringResult

use of org.springframework.integration.xml.config.StubResultFactory.StubStringResult in project spring-integration by spring-projects.

the class MarshallingTransformerParserTests method testCustomResultFactory.

@Test
public void testCustomResultFactory() throws Exception {
    MessageChannel input = (MessageChannel) appContext.getBean("marshallingTransformerCustomResultFactory");
    GenericMessage<Object> message = new GenericMessage<Object>("hello");
    input.send(message);
    Message<?> result = output.receive(0);
    assertTrue("Wrong payload type", result.getPayload() instanceof StubStringResult);
}
Also used : GenericMessage(org.springframework.messaging.support.GenericMessage) MessageChannel(org.springframework.messaging.MessageChannel) StubStringResult(org.springframework.integration.xml.config.StubResultFactory.StubStringResult) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 StubStringResult (org.springframework.integration.xml.config.StubResultFactory.StubStringResult)2 MessageChannel (org.springframework.messaging.MessageChannel)2 GenericMessage (org.springframework.messaging.support.GenericMessage)2