### Question:
DataSourceProvider implements Provider<DataSource> { @Override public DataSource get() { if (dataSource != null) { return dataSource; } return constructDataSource(); } @Inject  DataSourceProvider(CConfiguration cConf, SConfiguration sConf,
                            MetricsCollectionService metricsCollectionService); @Override DataSource get();  }### Answer:
@Test public void testInstantiate() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.Dataset.DATA_STORAGE_IMPLEMENTATION, Constants.Dataset.DATA_STORAGE_SQL); cConf.set(Constants.Dataset.DATA_STORAGE_SQL_DRIVER_DIRECTORY, TEMP_FOLDER.newFolder().getAbsolutePath()); cConf.set(Constants.Dataset.DATA_STORAGE_SQL_JDBC_DRIVER_NAME, NoopDriver.class.getName()); cConf.set(Constants.Dataset.DATA_STORAGE_SQL_JDBC_CONNECTION_URL, "jdbc:noop: File driverDir = new File(cConf.get(Constants.Dataset.DATA_STORAGE_SQL_DRIVER_DIRECTORY), cConf.get(Constants.Dataset.DATA_STORAGE_IMPLEMENTATION)); driverDir.mkdirs(); AppJarHelper.createDeploymentJar(new LocalLocationFactory(driverDir), NoopDriver.class); SConfiguration sConf = SConfiguration.create(); DataSourceProvider instantiator = new DataSourceProvider(cConf, sConf, new NoOpMetricsCollectionService()); DataSource dataSource = instantiator.get(); Assert.assertNotNull(dataSource); Enumeration<Driver> drivers = DriverManager.getDrivers(); Driver loadedDriver = null; int count = 0; while (drivers.hasMoreElements()) { Driver driver = drivers.nextElement(); if (driver instanceof JDBCDriverShim) { loadedDriver = driver; } count++; } Assert.assertEquals(2, count); Assert.assertNotNull(loadedDriver); }