### Question:
UpdateUtilImpl implements UpdateUtil { public ChannelXmlBean loadUpdateFromFileSystem(final String path) { ChannelXmlBean result = null; try { FileWrapper f = _fileWrapperFactory.create(path); if (!f.isDirectory()) { s_log.error("FileSystem path (" + path + ") is not a directory."); } else { f = _fileWrapperFactory.create(f, RELEASE_XML_FILENAME); result = _serializer.readChannelBean(f); } } catch (IOException e) { s_log.error("Unexpected exception while attempting " + "load updates from filesystem path (" + path + "): " + e.getMessage(), e); } return result; }  void setPathUtils(PathUtils pathUtils); void setFileWrapperFactory(FileWrapperFactory factory); void setApplicationFileWrappers(ApplicationFileWrappers appFileWrappers); void setIOUtilities(IOUtilities iou); void setUpdateXmlSerializer(UpdateXmlSerializer serializer); long getCheckSum(FileWrapper f); ChannelXmlBean downloadCurrentRelease(final String host, final int port, final String path,
		final String fileToGet, final IProxySettings proxySettings); ChannelXmlBean loadUpdateFromFileSystem(final String path); boolean downloadLocalUpdateFile(String fileToGet, String destDir); void copyFile(final FileWrapper from, final FileWrapper to); @Override void moveFiles(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir); void copyDir(FileWrapper fromDir, FileWrapper toDir); @Override void copyDir(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir); ChannelXmlBean getLocalReleaseInfo(String localReleaseFile); FileWrapper getSquirrelHomeDir(); FileWrapper getInstalledSquirrelMainJarLocation(); FileWrapper getSquirrelPluginsDir(); FileWrapper getSquirrelLibraryDir(); FileWrapper getSquirrelUpdateDir(); FileWrapper getDownloadsDir(); FileWrapper getCoreDownloadsDir(); FileWrapper getPluginDownloadsDir(); FileWrapper getI18nDownloadsDir(); FileWrapper getBackupDir(); FileWrapper getCoreBackupDir(); FileWrapper getI18nBackupDir(); FileWrapper getPluginBackupDir(); FileWrapper getChangeListFile(); void saveChangeList(List<ArtifactStatus> changes); ChangeListXmlBean getChangeList(); FileWrapper getLocalReleaseFile(); List<ArtifactStatus> getArtifactStatus(ChannelXmlBean channelXmlBean); List<ArtifactStatus> getArtifactStatus(ReleaseXmlBean releaseXmlBean); Set<String> getInstalledPlugins(); Set<String> getInstalledTranslations(); IPluginManager getPluginManager(); void setPluginManager(IPluginManager manager); FileWrapper checkDir(FileWrapper parent, String child); void createZipFile(FileWrapper zipFile, FileWrapper... sourceFiles); boolean deleteFile(FileWrapper path); void extractZipFile(FileWrapper zipFile, FileWrapper outputDirectory); ChangeListXmlBean getChangeList(FileWrapper changeListFile); FileWrapper getFile(FileWrapper installDir, String artifactName); String downloadHttpUpdateFile(final String host, final int port, final String fileToGet,
		final String destDir, final long fileSize, final long checksum, final IProxySettings proxySettings); FileWrapper getDownloadFileLocation(ArtifactStatus status); boolean isPresentInDownloadsDirectory(ArtifactStatus status); UpdateCheckFrequency getUpdateCheckFrequency(IUpdateSettings settings); final static int ZIP_EXTRACTION_BUFFER_SIZE; }### Answer:
@Test public void testLoadUpdateFromFileSystem() throws IOException { String pathToDirectoryThatContainsReleaseXml = "/path/to/release.xml/file"; String releaseXmlFilePath = "/path/to/release.xml/file/release.xml"; FileWrapper releaseXmlFileDir = getDirectoryMock("releaseXmlFileDir"); FileWrapper releaseXmlFile = getFileMock("releaseXmlFile", releaseXmlFilePath); expect(mockFileWrapperFactory.create(pathToDirectoryThatContainsReleaseXml)); expectLastCall().andReturn(releaseXmlFileDir); expect(mockFileWrapperFactory.create(releaseXmlFileDir, UpdateUtil.RELEASE_XML_FILENAME)); expectLastCall().andReturn(releaseXmlFile); ChannelXmlBean mockChannelXmlBean = mockHelper.createMock(ChannelXmlBean.class); expect(mockSerializer.readChannelBean(releaseXmlFile)).andReturn(mockChannelXmlBean); mockHelper.replayAll(); underTest.loadUpdateFromFileSystem(pathToDirectoryThatContainsReleaseXml); mockHelper.verifyAll(); }