### Question:
JScpWorker { public FileObject getFileObjectByUri(String file) throws URISyntaxException, FileSystemException { return getFileObjectByUri(URI.create(file)); } JScpWorker(String userName); FileObject getFileObjectByUri(String file); FileObject getFileObjectByUri(URI file); FileSystemOptions getSftpDefaultOptions();  }### Answer:
@Test public void testGetFileObjectByUri() throws Exception { JScpWorker worker = new JScpWorker("uname"); URL res = Thread.currentThread().getContextClassLoader().getResource("com/collective/celos/ci/testing/config/target.json"); FileObject object = worker.getFileObjectByUri(res.toURI()); IOUtils.contentEquals(object.getContent().getInputStream(), new FileInputStream(res.getFile())); }
@Test public void testGetFileObjectByUriStringParam() throws Exception { JScpWorker worker = new JScpWorker("uname"); URL res = Thread.currentThread().getContextClassLoader().getResource("com/collective/celos/ci/testing/config/target.json"); FileObject object = worker.getFileObjectByUri(res.toURI().toString()); IOUtils.contentEquals(object.getContent().getInputStream(), new FileInputStream(res.getFile())); }