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

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