Configuration conf = new Configuration();
conf.setClass("fs.mock.impl", MockFs.class, FileSystem.class);
Map<String, String> attributes = new HashMap<String, String>();
attributes.put(KEY_PATH, folder.getRoot().toURI().toString());
attributes.put(KEY_TEMP, "mock://" + folder.getRoot().toURI().toString());
DirectDataSourceProfile profile = new DirectDataSourceProfile(
"testing",
HadoopDataSource.class,
"context",
attributes);
HadoopDataSourceProfile.convert(profile, conf);