@Test
public void testAuthorizationFailure() throws Exception {

  user = "dummyUser";
  proxyUser = "test user2";
  when(realUserUGI.getShortUserName()).thenReturn(proxyUser);
  when(realUserUGI.getUserName()).thenReturn(proxyUser);
  when(userGroupInformation.getUserName()).thenReturn(user);
  when(userGroupInformation.getRealUser()).thenReturn(realUserUGI);
  LambdaTestUtils.intercept(AuthorizationException.class, "User: "
      + proxyUser + " is not allowed to impersonate " + user, () ->
      provider.authorize(userGroupInformation, "2.2.2.2"));
}