use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class FtpComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
FtpComponent comp = context.getComponent("ftp", FtpComponent.class);
EndpointConfiguration conf = comp.createConfiguration("ftp://myhost?username=foo&password=secret&soTimeout=1234");
assertEquals("foo", conf.getParameter("username"));
assertEquals("secret", conf.getParameter("password"));
assertEquals("1234", conf.getParameter("soTimeout"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"displayName\": \"Min Depth\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"displayName\": \"Username\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class LogComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
LogComponent comp = context.getComponent("log", LogComponent.class);
EndpointConfiguration conf = comp.createConfiguration("log:foo?level=DEBUG");
assertEquals("DEBUG", conf.getParameter("level"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"loggerName\": { \"kind\": \"path\", \"displayName\": \"Logger Name\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"level\": { \"kind\": \"parameter\", \"displayName\": \"Level\", \"group\": \"producer\", \"type\": \"string\""));
assertTrue(json.contains("\"showBody\": { \"kind\": \"parameter\", \"displayName\": \"Show Body\", \"group\": \"formatting\", \"label\": \"formatting\""));
}
use of org.apache.camel.EndpointConfiguration 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.EndpointConfiguration in project camel by apache.
the class SedaComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
SedaComponent comp = context.getComponent("seda", SedaComponent.class);
EndpointConfiguration conf = comp.createConfiguration("seda:foo?blockWhenFull=true");
assertEquals("true", conf.getParameter("blockWhenFull"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"concurrentConsumers\": { \"kind\": \"parameter\", \"displayName\": \"Concurrent Consumers\", \"group\": \"consumer\", \"label\": \"consumer\""));
assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\""));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class EndpointConfigurationTest method testConfigurationEquals.
@Test
public void testConfigurationEquals() throws Exception {
EndpointConfiguration cfg1 = ConfigurationHelper.createConfiguration("mapped://foo?one=true&two=2", context);
EndpointConfiguration cfg2 = ConfigurationHelper.createConfiguration("mapped://foo?two=2&one=true", context);
String uri1 = cfg1.toUriString(EndpointConfiguration.UriFormat.Complete);
String uri2 = cfg2.toUriString(EndpointConfiguration.UriFormat.Complete);
assertEquals("Query parameter order should not matter", uri1, uri2);
}
Aggregations