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

  OriginEntity origin = new OriginEntity()
          .setId(UUID.randomUUID())
          .setOrganizationID(UUID.randomUUID());
  when(originResolver.apply(origin.getId())).thenReturn(origin);
  doThrow(AccessDeniedException.class).when(securityContext).checkReadPermission(origin);
  delegate.handle(new GetOriginByIdRequest().setId(origin.getId()));
}