@Test(expected = AccessDeniedException.class)
public void testCheckPermissionThrowsAccessDeniedException() throws Exception {

  when(accessController.hasPermission(credentials, viewThreatIntelFact)).thenReturn(false);
  context.checkPermission(viewThreatIntelFact);
}