@Test(expected = IOException.class)
public void testTokenFetchFail() throws Exception {

  WebHdfsFileSystem fs = mock(WebHdfsFileSystem.class);
  doThrow(new IOException()).when(fs).getDelegationToken(any());
  Path p = new Path(f.getRoot().getAbsolutePath(), tokenFile);
  DelegationTokenFetcher.saveDelegationToken(conf, fs, null, p);
}