@Test(expected = AuthenticationFailedException.class)
public void testCheckPermissionThrowsAuthenticationFailedException() throws Exception {

  when(accessController.hasPermission(credentials, viewThreatIntelFact)).thenThrow(InvalidCredentialsException.class);
  context.checkPermission(viewThreatIntelFact);
}