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

  UUID organizationID = UUID.randomUUID();
  when(identityResolver.resolveOrganizationIdentity(organizationID)).thenReturn(organization);
  when(accessController.hasPermission(credentials, viewThreatIntelFact, organization)).thenThrow(InvalidCredentialsException.class);
  context.checkPermission(viewThreatIntelFact, organizationID);
}