|
@@ -133,15 +133,16 @@ public class TestDelegationTokenFetcher {
|
|
Iterator<Token<?>> itr = creds.getAllTokens().iterator();
|
|
Iterator<Token<?>> itr = creds.getAllTokens().iterator();
|
|
// make sure we got back exactly the 1 token we expected
|
|
// make sure we got back exactly the 1 token we expected
|
|
assertTrue(itr.hasNext());
|
|
assertTrue(itr.hasNext());
|
|
- assertNotNull("Token without renewer shouldn't be null", itr.next());
|
|
|
|
|
|
+ final Token token = itr.next();
|
|
|
|
+ assertNotNull("Token without renewer shouldn't be null", token);
|
|
assertTrue(!itr.hasNext());
|
|
assertTrue(!itr.hasNext());
|
|
try {
|
|
try {
|
|
// Without renewer renewal of token should fail.
|
|
// Without renewer renewal of token should fail.
|
|
DelegationTokenFetcher.main(new String[] { "--renew", tokenFile });
|
|
DelegationTokenFetcher.main(new String[] { "--renew", tokenFile });
|
|
fail("Should have failed to renew");
|
|
fail("Should have failed to renew");
|
|
} catch (AccessControlException e) {
|
|
} catch (AccessControlException e) {
|
|
- GenericTestUtils.assertExceptionContains(
|
|
|
|
- "tried to renew a token without a renewer", e);
|
|
|
|
|
|
+ GenericTestUtils.assertExceptionContains("tried to renew a token ("
|
|
|
|
+ + token.decodeIdentifier() + ") without a renewer", e);
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
cluster.shutdown();
|
|
cluster.shutdown();
|