@Test
public void testLocalMRTokenRenewal() throws IOException {
String user = UserGroupInformation.getLoginUser().getUserName();
DelegationTokenIdentifier ident = new DelegationTokenIdentifier(
new Text(user), new Text(user), null);
Token<?> t = new Token<DelegationTokenIdentifier>(
ident.getBytes(),
new byte[]{},
org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier.MAPREDUCE_DELEGATION_KIND,
new Text("service"));
assertTrue(t.isManaged());
ident = new DelegationTokenIdentifier(
new Text(user), new Text(user+"-is-not-me"), null);
t = new Token<DelegationTokenIdentifier>(
ident.getBytes(),
new byte[]{},
org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier.MAPREDUCE_DELEGATION_KIND,
new Text("service"));
assertFalse(t.isManaged());