throws IOException {
String owner = UserGroupInformation.getCurrentUser().getUserName();
String realUser =
UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
UserGroupInformation.getCurrentUser().getRealUser().getUserName();
TestDelegationTokenIdentifier tokenId =
new TestDelegationTokenIdentifier(
new Text(owner), renewer, new Text(realUser));
return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}