### Question:
DataSourceParser { public DataSource parse(String url) { if (url.startsWith("classpath: String path = url.replaceAll("classpath: return DataSourceFactory.classPathDataSource(path); } if (url.startsWith("file: String path = url.replaceAll("file: return DataSourceFactory.fileSystemDataSource(path); } if (url.startsWith("http: return DataSourceFactory.remoteDataSource(url); } return dataSourceProvider.get(url); }  void setDataSourceProvider(DataSourceProvider dataSourceProvider); DataSource parse(String url);  }### Answer:
@Test public void shouldReturnClassPathDataSource() { String path = "assets/images/image.png"; DataSource dataSource = new DataSourceParser().parse("classpath: assertTrue(dataSource instanceof ClassPathDataSource); assertEquals("classpath: }
@Test public void shouldReturnFileSystemDataSource() { String path = "assets/images/image.png"; DataSource dataSource = new DataSourceParser().parse("file: assertTrue(dataSource instanceof FileSystemDataSource); assertEquals("file: }
@Test public void shouldReturnRemoteDataSource() { String path = "assets/images/image.png"; DataSource dataSource = new DataSourceParser().parse("http: assertTrue(dataSource instanceof RemoteDataSource); assertEquals("http: }
@Test public void shouldReturnDefaultDataSource() { String path = "assets/images/image.png"; DataSource dataSource = new DataSourceParser().parse(path); assertTrue(dataSource instanceof ClassPathDataSource); assertEquals("classpath: }