title: Java JUnit: Testing a readFile method using a temporary file, FileUtils cannot be resolved
body: <p>I have a problem with java, it gives me an error inside my code when I run a test for writing to a file.
  It isn’t finished yet but in the test I create a sort of ‘mock’ temporary file where I write a string.
  **as my code shouldn't be allowed to read strings</p>
  <pre><code>@Rule
         public TemporaryFolder tempFolder = new TemporaryFolder();
       @Test
         public void testWrite() throws IOException {
           // Create a temporary file.
           final File tempFile = tempFolder.newFile(&quot;tempFile.txt&quot;);
         
           // Write something to it.
           FileUtils.writeStringToFile(tempFile, &quot;hello world&quot;);
         }
  </code></pre>
  <p>Unfortunately the FileUtils seems not to be recognised.
  Relating to that the import:</p>
  <pre><code>import org.apache.commons.io.FileUtils;
  </code></pre>
  <p>Isn’t recognised either.</p>