title: unit testing functions with Apache Camel Exchange as parameter
body: <p>I am doing java camel development and I want to unit test(junit4) a bunch of functions with Exchange being passed in as parameter.</p>
  
  <p>For example :</p>
  
  <pre><code>public finalObject getProperty(final Exchange exchange, final String property) throws Exception {
     //all about getting property from xml message in exchange via xpath
  }
  </code></pre>
  
  <p>Question:
  1>Can I use EasyMock to mock Exchange ? And how to set a predefined xml as incoming message inside the exchange ?</p>
  
  <p>2>If not do I need to setup camel test ? How to set a predefined xml as incoming message inside the exchange with camel test.</p>
  
  <p>Thanks a lot.</p>