HDFSMetadataService { public String getDefaultFsUrl() { return hdfsConfiguration.get(CONFIG_KEY_DEFAULT_FS); } HDFSMetadataService(Configuration hdfsConfiguration); static HDFSMetadataService newInstance(EnvironmentService environmentService, Long clusterId); String getDefaultFsUrl(); static final String CONFIG_KEY_DEFAULT_FS; }
@Test public void getDefaultFsUrl() throws Exception { HDFSMetadataService hdfsMetadataService = new HDFSMetadataService(configuration); new Expectations() {{ configuration.get(HDFSMetadataService.CONFIG_KEY_DEFAULT_FS); result = TEST_FS_URL; }}; Assert.assertEquals(TEST_FS_URL, hdfsMetadataService.getDefaultFsUrl()); }