use of org.apache.camel.component.mock.MockComponent in project camel by apache.
the class ManagedCustomComponentNameTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
context.addComponent("foo", new MockComponent());
from("direct:start").to("foo:foo").to("mock:result");
}
};
}
use of org.apache.camel.component.mock.MockComponent in project camel by apache.
the class RecipientListInterceptSendToEndpointException method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
// simulate ftp/http using mocks
context.addComponent("ftp", new MockComponent());
context.addComponent("http", new MockComponent());
interceptSendToEndpoint("(ftp|http):.*").to("log:intercept").to("mock:intercept");
from("direct:start").recipientList(header("foo")).parallelProcessing().to("mock:end");
}
};
}
use of org.apache.camel.component.mock.MockComponent in project camel by apache.
the class MockComponentAutoConfiguration method configureMockComponent.
@Lazy
@Bean(name = "mock-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(MockComponent.class)
public MockComponent configureMockComponent(CamelContext camelContext) throws Exception {
MockComponent component = new MockComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.apache.camel.component.mock.MockComponent in project camel by apache.
the class MockComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
MockComponent comp = context.getComponent("mock", MockComponent.class);
EndpointConfiguration conf = comp.createConfiguration("mock:foo?retainFirst=10");
assertEquals("10", conf.getParameter("retainFirst"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"expectedCount\": { \"kind\": \"parameter\", \"displayName\": \"Expected Count\", \"group\": \"producer\", \"label\": \"producer\""));
assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
}
use of org.apache.camel.component.mock.MockComponent in project ddf by codice.
the class ContentDirectoryMonitorTest method setup.
@Before
public void setup() throws Exception {
monitoredDirectory = temporaryFolder.newFolder("inbox");
monitoredDirectoryPath = monitoredDirectory.getCanonicalPath();
camelContext = super.createCamelContext();
camelContext.start();
MockComponent contentComponent = new MockComponent();
camelContext.addComponent("content", contentComponent);
MockComponent catalogComponent = new MockComponent();
camelContext.addComponent("catalog", catalogComponent);
monitor = createContentDirectoryMonitor();
}
Aggregations