FileLocator { public File locateFile(String path) { if (isNullOrEmpty(path)) { return null; } File localFile = new File(path); if (localFile.exists() && localFile.isFile()) { return localFile; } String outputFile = tmpOutputFileName(path); try { return resourceManager.getResourceAsFile(path, outputFile); } catch (ResourceNotFoundException e) { throw new RuntimeException("Unable to locate file with path: " + path, e); } catch (FileResourceCreationException e) { throw new RuntimeException("Unable to create temporary file '" + outputFile + "' in the output directory", e); } } FileLocator(ResourceManager resourceManager, File baseDir, File buildDir); File locateFile(String path); File getBaseDir(); File getBuildDir();  }
@Test public void locateEmptyString() { assertNull(fileLocator.locateFile("")); }
@Test public void locateNull() { assertNull(fileLocator.locateFile(null)); }