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

  Configuration conf = new Configuration();
  DummyFs fs = spy(new DummyFs());
  Token<TokenIdentifier> token = new Token<TokenIdentifier>(new byte[0],
      new byte[0], DummyFs.TOKEN_KIND, new Text("127.0.0.1:1234"));
  doReturn(token).when(fs).getDelegationToken(any());
  doReturn(token).when(fs).getRenewToken();
  fs.initialize(new URI("dummyfs://127.0.0.1:1234"), conf);
  fs.tokenAspect.ensureTokenInitialized();
  // Select a token, store and renew it
  verify(fs).setDelegationToken(token);
  assertNotNull(Whitebox.getInternalState(fs.tokenAspect, "dtRenewer"));
  assertNotNull(Whitebox.getInternalState(fs.tokenAspect, "action"));
}