@Test
public void testGetRecord() throws Exception {

    // Setup:
    Record record = recordFactory.createNew(RECORD_IRI);
    record.setCatalog(catalogFactory.createNew(distributedCatalogId));
    doReturn(Optional.of(record)).when(utilsService).optObject(eq(RECORD_IRI), eq(recordFactory), any(RepositoryConnection.class));
    Optional<Record> result = manager.getRecord(distributedCatalogId, RECORD_IRI, recordFactory);
    verify(utilsService).validateResource(eq(distributedCatalogId), eq(catalogFactory.getTypeIRI()), any(RepositoryConnection.class));
    verify(utilsService).optObject(eq(RECORD_IRI), eq(recordFactory), any(RepositoryConnection.class));
    assertTrue(result.isPresent());
    assertEquals(record, result.get());
}