title: Mocking File Endpoints in Camel
body: <p>I wish to unit test a camel route that looks as follows:</p>
  
  <pre><code>from("file://config")
      .process(configProcessor)
  </code></pre>
  
  <p>I've replaced the from with a direct endpoint using adviceWith and have a producer template to send a test exchange, however the body of the In exchange in the <code>configProcessor</code> is of the type File and questions like <a href="https://stackoverflow.com/questions/17681708/mocking-files-in-java-mock-contents-mockito">Mocking Files in Java - Mock Contents - Mockito</a> recommend against trying to mock File objects.</p>
  
  <p>Is it possible to pass another object that extends File but doesn't write to disk, or should I create a temporary file, or even refactor the <code>configProcessor</code> to split out the I/O from the processing?</p>