Search in sources :

Example 1 with SetHeaderDefinition

use of org.apache.camel.model.SetHeaderDefinition in project ddf by codice.

the class ContentDirectoryMonitorTest method testDirectoryMonitorWithParameters.

@Test
public void testDirectoryMonitorWithParameters() {
    ContentDirectoryMonitor monitor = createContentDirectoryMonitor();
    submitConfigOptions(monitor, monitoredDirectoryPath, ContentDirectoryMonitor.MOVE, ATTRIBUTE_OVERRIDES, 1, 1000);
    RouteDefinition routeDefinition = camelContext.adapt(ModelCamelContext.class).getRouteDefinitions().get(0);
    ProcessorDefinition<?> firstProcessor = routeDefinition.getOutputs().get(0);
    assertThat(firstProcessor, is(instanceOf(SetHeaderDefinition.class)));
    assertThat(((SetHeaderDefinition) firstProcessor).getExpression().evaluate(exchange, String.class), is("{test2=[(some,parameter,with,commas)], test1=[someParameter1, someParameter0]}"));
}
Also used : RouteDefinition(org.apache.camel.model.RouteDefinition) SetHeaderDefinition(org.apache.camel.model.SetHeaderDefinition) Test(org.junit.Test)

Aggregations

RouteDefinition (org.apache.camel.model.RouteDefinition)1 SetHeaderDefinition (org.apache.camel.model.SetHeaderDefinition)1 Test (org.junit.Test)1