use of org.apache.camel.component.dataformat.DataFormatComponent in project camel by apache.
the class DataFormatComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
DataFormatComponent comp = context.getComponent("dataformat", DataFormatComponent.class);
EndpointConfiguration conf = comp.createConfiguration("dataformaat:marshal:string?charset=iso-8859-1");
assertEquals("iso-8859-1", conf.getParameter("charset"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true, \"type\": \"string\", \"javaType\": \"java.lang.String\"," + " \"deprecated\": false, \"secret\": false, \"description\": \"Name of data format\" }"));
assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"displayName\": \"Operation\", \"group\": \"producer\", \"required\": true, \"type\": \"string\""));
assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
use of org.apache.camel.component.dataformat.DataFormatComponent in project camel by apache.
the class DataFormatComponentAutoConfiguration method configureDataFormatComponent.
@Lazy
@Bean(name = "dataformat-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(DataFormatComponent.class)
public DataFormatComponent configureDataFormatComponent(CamelContext camelContext) throws Exception {
DataFormatComponent component = new DataFormatComponent();
component.setCamelContext(camelContext);
return component;
}
Aggregations