Search in sources :

Example 1 with BrowseComponent

use of org.apache.camel.component.browse.BrowseComponent in project camel by apache.

the class BrowseComponentAutoConfiguration method configureBrowseComponent.

@Lazy
@Bean(name = "browse-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BrowseComponent.class)
public BrowseComponent configureBrowseComponent(CamelContext camelContext) throws Exception {
    BrowseComponent component = new BrowseComponent();
    component.setCamelContext(camelContext);
    return component;
}
Also used : BrowseComponent(org.apache.camel.component.browse.BrowseComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with BrowseComponent

use of org.apache.camel.component.browse.BrowseComponent in project camel by apache.

the class BrowseComponentConfigurationAndDocumentationTest method testComponentConfiguration.

@Test
public void testComponentConfiguration() throws Exception {
    BrowseComponent comp = context.getComponent("browse", BrowseComponent.class);
    EndpointConfiguration conf = comp.createConfiguration("browse:seda:foo?synchronous=true");
    assertEquals("true", conf.getParameter("synchronous"));
    ComponentConfiguration compConf = comp.createComponentConfiguration();
    String json = compConf.createParameterJsonSchema();
    assertNotNull(json);
    assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
    assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
Also used : ComponentConfiguration(org.apache.camel.ComponentConfiguration) BrowseComponent(org.apache.camel.component.browse.BrowseComponent) EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Aggregations

BrowseComponent (org.apache.camel.component.browse.BrowseComponent)2 ComponentConfiguration (org.apache.camel.ComponentConfiguration)1 EndpointConfiguration (org.apache.camel.EndpointConfiguration)1 Test (org.junit.Test)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 ConditionalOnClass (org.springframework.boot.autoconfigure.condition.ConditionalOnClass)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 Lazy (org.springframework.context.annotation.Lazy)1