@Test public void testAggregateOldNull() { MessageAggregationStrategy mas = new MessageAggregationStrategy(); Exchange newExchange = new DefaultExchange((CamelContext) null); newExchange.getIn().setBody("TEST2"); Exchange output = mas.aggregate(null, newExchange); String outputBody = (String) output.getIn().getBody(); assertEquals(newExchange, output); assertEquals("TEST2", outputBody); }
@Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String in1 = (String) oldExchange.getIn().getBody(); String in2 = (String) newExchange.getIn().getBody(); oldExchange.getIn().setBody(in1 + ";" + in2); return oldExchange; }
MessageAggregationStrategy implements AggregationStrategy { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String in1 = (String) oldExchange.getIn().getBody(); String in2 = (String) newExchange.getIn().getBody(); oldExchange.getIn().setBody(in1 + ";" + in2); return oldExchange; } }
MessageAggregationStrategy implements AggregationStrategy { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String in1 = (String) oldExchange.getIn().getBody(); String in2 = (String) newExchange.getIn().getBody(); oldExchange.getIn().setBody(in1 + ";" + in2); return oldExchange; }  }
MessageAggregationStrategy implements AggregationStrategy { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String in1 = (String) oldExchange.getIn().getBody(); String in2 = (String) newExchange.getIn().getBody(); oldExchange.getIn().setBody(in1 + ";" + in2); return oldExchange; }  @Override Exchange aggregate(Exchange oldExchange, Exchange newExchange); }
MessageAggregationStrategy implements AggregationStrategy { @Override public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String in1 = (String) oldExchange.getIn().getBody(); String in2 = (String) newExchange.getIn().getBody(); oldExchange.getIn().setBody(in1 + ";" + in2); return oldExchange; }  @Override Exchange aggregate(Exchange oldExchange, Exchange newExchange);  }