@Test
public void testGetRemoteTokenFailure() throws IOException,
    URISyntaxException {

  Configuration conf = new Configuration();
  DummyFs fs = spy(new DummyFs());
  IOException e = new IOException();
  doThrow(e).when(fs).getDelegationToken(anyString());
  fs.emulateSecurityEnabled = true;
  fs.initialize(new URI("dummyfs://127.0.0.1:1234"), conf);
  try {
    fs.tokenAspect.ensureTokenInitialized();
  } catch (IOException exc) {
    assertEquals(e, exc);
  }
}