### Question:
FileSystemDataSource implements DataSource { public InputStream getInputStream() { try { if (logger.isInfoEnabled()) logger.info("loading stream " + getResourceName()); return new FileInputStream(new File(path)); } catch (FileNotFoundException e) { throw new RuntimeException("File for " + resourceName + " not found", e); } } FileSystemDataSource(String path); InputStream getInputStream(); @Override String getResourceName(); @Override URI getUri(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testGetInputStream() throws URISyntaxException { URL resource = Thread.currentThread().getContextClassLoader().getResource("test.properties"); FileSystemDataSource dataSource = new FileSystemDataSource(new File(resource.toURI()).getAbsolutePath()); assertThat(dataSource.getInputStream(), IsNull.notNullValue()); }
@Test(expected=RuntimeException.class) public void testFailToGetInputStream() { FileSystemDataSource dataSource = new FileSystemDataSource("not.txt"); dataSource.getInputStream(); }