@Test
public void testMessageHeadersRelaysSpringContext() throws Exception {
CxfEndpoint endpoint = (CxfEndpoint)context
.getEndpoint("cxf:bean:serviceExtraRelays?headerFilterStrategy=#customMessageFilterStrategy");
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());
}
}