@Test
public void testFetchNonExistingObjectById() throws Exception {

  GetObjectByIdRequest request = new GetObjectByIdRequest().setId(UUID.randomUUID());
  doThrow(AccessDeniedException.class).when(securityContext).checkReadPermission((ObjectRecord) isNull());
  try {
    delegate.handle(request);
    fail();
  } catch (AccessDeniedException ignored) {
    verify(objectFactDao).getObject(request.getId());
    verifyNoMoreInteractions(objectFactDao);
  }
}