> There is also an ExchangeBuilder AFAIR that you may use as well. Then
> you can use that to create an exchange, to send with the produce
> template.

ExchangeBuilder is cool indeed, I forgot about it. :)

BTW Probably having bean mocking API similar to the one presented
below would be a nice addition to our testing API. However creating
such API is not as trivial as it might look like, because of the rich
bean binding capabilities that it should support.

@Bean // Spring Java config Example
MyBean myBean() {
  return MockBean.createMockBean(MyBean.class).
    removeHeader("foo"). // this mock will remove given header from exchange
    addProperty("prop"). // add property that couldn't be added before
    assertHeader("bar").isEqualTo("baz"); // and make some assertions
}

from(...).bean("myBean", "myMethod").to(...);

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Reply via email to