use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class BlueprintPropertiesLocationElementOptionalTest method testPropertiesLocationElement.
@Test
public void testPropertiesLocationElement() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedHeaderReceived("property-1", "property-value-1");
mock.expectedHeaderReceived("property-2", "property-value-2");
mock.expectedHeaderReceived("cm", "cm-value");
PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
assertNotNull("Properties component not defined", pc);
List<PropertiesLocation> locations = pc.getLocations();
assertNotNull(locations);
assertEquals("Properties locations", 3, locations.size());
template.sendBody("direct:start", null);
mock.assertIsSatisfied();
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class BlueprintPropertiesLocationElementTest method testPropertiesLocationElement.
@Test
public void testPropertiesLocationElement() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedHeaderReceived("property-1", "property-value-1");
mock.expectedHeaderReceived("property-2", "property-value-2");
mock.expectedHeaderReceived("cm", "cm-value");
PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
assertNotNull("Properties component not defined", pc);
List<PropertiesLocation> locations = pc.getLocations();
assertNotNull(locations);
assertEquals("Properties locations", 3, locations.size());
template.sendBody("direct:start", null);
mock.assertIsSatisfied();
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class ReportIncidentRoutesTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camel = super.createCamelContext();
camel.addComponent("properties", new PropertiesComponent("classpath:incident.properties,file:target/custom.properties"));
return camel;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class BaseUndertowTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
context.addComponent("properties", new PropertiesComponent("ref:prop"));
return context;
}
use of org.apache.camel.component.properties.PropertiesComponent in project camel by apache.
the class Application method properties.
@Produces
@ApplicationScoped
@Named("properties")
// "properties" component bean that Camel uses to lookup properties
PropertiesComponent properties(PropertiesParser parser) {
PropertiesComponent component = new PropertiesComponent();
// Use DeltaSpike as configuration source for Camel CDI
component.setPropertiesParser(parser);
return component;
}
Aggregations