### Question:
HadoopDataSourceUtil { public static DirectDataSourceRepository loadRepository(Configuration conf) { if (conf == null) { throw new IllegalArgumentException("conf must not be null"); } List<DirectDataSourceProfile> profiles = loadProfiles(conf); return createRepository(conf, profiles); } private  HadoopDataSourceUtil(); static List<DirectDataSourceProfile> loadProfiles(Configuration conf); static DirectDataSourceRepository loadRepository(Configuration conf); static boolean isLocalAttemptOutputDefined(LocalFileSystem localFileSystem); static Path getLocalTemporaryDirectory(LocalFileSystem localFileSystem); static OutputTransactionContext createContext(String executionId, String datasourceId); @Deprecated static OutputTransactionContext createContext(JobContext context, String datasourceId); @Deprecated static OutputAttemptContext createContext(TaskAttemptContext context, String datasourceId); static String getTransactionInfoExecutionId(Path transactionInfoPath); static Path getTransactionInfoPath(Configuration conf, String executionId); static Path getCommitMarkPath(Configuration conf, String executionId); static Collection<FileStatus> findAllTransactionInfoFiles(Configuration conf); static Path getSystemDir(Configuration conf); static Path getSystemDir(Configuration conf, boolean resolve); static List<FileStatus> search(FileSystem fs, Path base, FilePattern pattern); static List<FileStatus> onlyMinimalCovered(List<FileStatus> statList); static boolean contains(Path parent, Path child); static void move(
            Counter counter, FileSystem fs,
            Path from, Path to); static void moveFromLocal(
            Counter counter,
            LocalFileSystem localFs, FileSystem fs,
            Path from, Path to); static void move(
            Counter counter, FileSystem fs,
            Path from, Path to, int threads); static HadoopFileFormat<T> toHadoopFileFormat(
            Configuration configuration, DataFormat<T> format); static final String PREFIX; static final String KEY_PATH; static final String KEY_SYSTEM_DIR; static final String KEY_LOCAL_TEMPDIR; static final String PREFIX_BEGIN_MARK; static final String PREFIX_COMMIT_MARK; static final String DEFAULT_SYSTEM_DIR; static final String TRANSACTION_INFO_DIR; static final Charset COMMENT_CHARSET; }### Answer:
@Test public void loadRepository() throws Exception { Configuration conf = new Configuration(); conf.set(key("testing"), MockHadoopDataSource.class.getName()); conf.set(key("testing", "path"), "testing"); conf.set(key("testing", "hello"), "world"); DirectDataSourceRepository repo = HadoopDataSourceUtil.loadRepository(conf); DirectDataSource ds = repo.getRelatedDataSource("testing"); assertThat(ds, instanceOf(MockHadoopDataSource.class)); MockHadoopDataSource mock = (MockHadoopDataSource) ds; assertThat(mock.conf, is(notNullValue())); assertThat(mock.profile.getPath(), is("testing")); }