AggregatorAdapter extends AdapterSupport implements AggregationStrategy { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { Object newInput = adaptAggregationInput(newExchange); Object oldInput = adaptInput(oldExchange); Object params = adaptParams(oldExchange); if (params == null) { doAggregate(oldExchange, oldInput, newInput, (Object[])null); } else if (params.getClass().isArray()) { doAggregate(oldExchange, oldInput, newInput, (Object[])params); } else { doAggregate(oldExchange, oldInput, newInput, params); } return oldExchange; } AggregatorAdapter(Aggregator aggregator); AggregatorAdapter aggregationInput(Expression aggregationInputExpression); AggregatorAdapter aggregationInput(Closure aggregationInputExpressionLogic); @Override Exchange aggregate(Exchange oldExchange, Exchange newExchange);  }
@Test public void testAggregateDefault() { strategy = new AggregatorAdapter(new TestAggregator()); Exchange a = exchangeWithInBody("a"); Exchange b = exchangeWithInBody("b"); strategy.aggregate(a, b); assertEquals("a:b", a.getIn().getBody()); }