@Test
public void testFetchObjectByTypeValue() throws Exception {

  GetObjectByTypeValueRequest request = new GetObjectByTypeValueRequest().setType("type").setValue("value");
  ObjectRecord object = new ObjectRecord().setId(UUID.randomUUID());
  when(objectFactDao.getObject(request.getType(), request.getValue())).thenReturn(object);
  assertNotNull(delegate.handle(request));
  verify(securityContext).checkReadPermission(object);
  verify(objectFactDao).calculateObjectStatistics(argThat(criteria -> {
    assertEquals(Collections.singleton(object.getId()), criteria.getObjectID());
    assertNotNull(criteria.getCurrentUserID());
    assertNotNull(criteria.getAvailableOrganizationID());
    return true;
  }));
}