@Test public void cannotFindFileThatDoesNotMatch() { Optional<FileLocator.FileResult> result = fileLocator.find("hello.json", emptyList()); assertFalse(result.isPresent()); result = fileLocator.find("p1/hello.json.json", emptyList()); assertFalse(result.isPresent()); result = fileLocator.find("p1/hello.xml.json", emptyList()); assertFalse(result.isPresent()); result = fileLocator.find("does/not/exist", emptyList()); assertFalse(result.isPresent()); }
Optional<FileResult> find(String path, List<String> accept) { Optional<FileResult> result = findExactMatch(path); if (!result.isPresent()) { result = findWithExtension(path, accept); } return result; }
FileLocator { Optional<FileResult> find(String path, List<String> accept) { Optional<FileResult> result = findExactMatch(path); if (!result.isPresent()) { result = findWithExtension(path, accept); } return result; } }
FileLocator { Optional<FileResult> find(String path, List<String> accept) { Optional<FileResult> result = findExactMatch(path); if (!result.isPresent()) { result = findWithExtension(path, accept); } return result; } FileLocator(File rootDir, Map<String, String> mimeByFileExtension); }
FileLocator { Optional<FileResult> find(String path, List<String> accept) { Optional<FileResult> result = findExactMatch(path); if (!result.isPresent()) { result = findWithExtension(path, accept); } return result; } FileLocator(File rootDir, Map<String, String> mimeByFileExtension);  }
FileLocator { Optional<FileResult> find(String path, List<String> accept) { Optional<FileResult> result = findExactMatch(path); if (!result.isPresent()) { result = findWithExtension(path, accept); } return result; } FileLocator(File rootDir, Map<String, String> mimeByFileExtension);   }