@Test
public void testGetVersionedRecord() throws Exception {

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