title: Camel testing with Thread.sleep()
body: <p>In <a href="https://rads.stackoverflow.com/amzn/click/com/1935182366" rel="nofollow noreferrer" rel="nofollow noreferrer">"Camel in action"</a> book I found this test example:</p>
  
  <pre><code>@Test
  public void testMoveFile() throws Exception {
      // create a new file in the inbox folder with the name hello.txt and containing Hello World as body
      template.sendBodyAndHeader("file://target/inbox", "Hello World", Exchange.FILE_NAME, "hello.txt");
  
      // wait a while to let the file be moved
      Thread.sleep(2000);
  
      // test the file was moved
      File target = new File("target/outbox/hello.txt");
      assertTrue("File should have been moved", target.exists());
  
      // test that its content is correct as well
      String content = context.getTypeConverter().convertTo(String.class, target);
      assertEquals("Hello World", content);
  }
  </code></pre>
  
  <p>Obviously It is an integration test - we test more than one unit, but: </p>
  
  <ul>
  <li>Are tests like that (with Thread.sleep) considered as good practice? </li>
  <li>Can we do better, leaving integration test approach
  ?</li>
  </ul>