use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class MixedStreamCachingInterceptorTest method testNoStreamCaching.
public void testNoStreamCaching() throws Exception {
MockEndpoint b = getMockEndpoint("mock:b");
b.expectedMessageCount(1);
StreamSource message = new StreamSource(new StringReader("<hello>world!</hello>"));
template.sendBody("direct:b", message);
assertMockEndpointsSatisfied();
Exchange exchange = b.getExchanges().get(0);
StreamSource stream = assertIsInstanceOf(StreamSource.class, exchange.getIn().getBody());
assertNotNull(stream);
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class NoStreamCachingInterceptorTest method testNoStreamCachingInterceptorEnabled.
public void testNoStreamCachingInterceptorEnabled() throws Exception {
MockEndpoint a = getMockEndpoint("mock:a");
a.expectedMessageCount(1);
StreamSource message = new StreamSource(new StringReader("<hello>world!</hello>"));
template.sendBody("direct:a", message);
assertMockEndpointsSatisfied();
Exchange exchange = a.getExchanges().get(0);
StreamSource stream = assertIsInstanceOf(StreamSource.class, exchange.getIn().getBody());
assertNotNull(stream);
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SpringPackageTest method testFoundRoute.
public void testFoundRoute() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
template.sendBody("direct:start", "Hello World");
mock.assertIsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SpringPropertyPlaceholderFileEndpointIssueTest method testSpring.
public void testSpring() throws Exception {
deleteDirectory("target/issue");
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
mock.expectedFileExists("target/issue/foo.txt");
template.sendBodyAndHeader("direct:start", "Hello World", "foo", "foo.txt");
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class StringDataFormatTest method testMarshalString.
public void testMarshalString() throws Exception {
// include a UTF-8 char in the text จ is a Thai elephant
String body = "Hello Thai Elephant จ";
MockEndpoint mock = getMockEndpoint("mock:marshal");
mock.expectedMessageCount(1);
byte[] out = (byte[]) template.requestBody("direct:marshal", body);
assertMockEndpointsSatisfied();
String result = new String(out, "UTF-8");
assertEquals(body, result);
}
Aggregations