use of org.apache.camel.component.test.TestComponent in project camel by apache.
the class TestComponentAutoConfiguration method configureTestComponent.
@Lazy
@Bean(name = "test-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(TestComponent.class)
public TestComponent configureTestComponent(CamelContext camelContext) throws Exception {
TestComponent component = new TestComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.apache.camel.component.test.TestComponent in project camel by apache.
the class TestComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
TestComponent comp = context.getComponent("test", TestComponent.class);
EndpointConfiguration conf = comp.createConfiguration("test:my:foo?timeout=1000");
assertEquals("1000", conf.getParameter("timeout"));
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("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
}
Aggregations