use of org.apache.camel.component.cxf.common.header.MessageHeaderFilter in project camel by apache.
the class CxfMessageHeadersRelayTest method testMessageHeadersRelaysSpringContext.
@Test
public void testMessageHeadersRelaysSpringContext() throws Exception {
CxfEndpoint endpoint = context.getEndpoint("cxf:bean:serviceExtraRelays?headerFilterStrategy=#customMessageFilterStrategy", CxfEndpoint.class);
CxfHeaderFilterStrategy strategy = (CxfHeaderFilterStrategy) endpoint.getHeaderFilterStrategy();
List<MessageHeaderFilter> filters = strategy.getMessageHeaderFilters();
assertEquals("Expected number of filters ", 2, filters.size());
Map<String, MessageHeaderFilter> messageHeaderFilterMap = strategy.getMessageHeaderFiltersMap();
for (String ns : new CustomHeaderFilter().getActivationNamespaces()) {
assertEquals("Expected a filter class for namespace: " + ns, CustomHeaderFilter.class, messageHeaderFilterMap.get(ns).getClass());
}
}
Aggregations