@Test
public void testGetUnversionedDistribution() throws Exception {

    // Setup:
    UnversionedRecord record = unversionedRecordFactory.createNew(UNVERSIONED_RECORD_IRI);
    Distribution dist = distributionFactory.createNew(DISTRIBUTION_IRI);
    record.setUnversionedDistribution(Collections.singleton(dist));
    doReturn(record).when(utilsService).getRecord(eq(distributedCatalogId), eq(UNVERSIONED_RECORD_IRI), eq(unversionedRecordFactory), any(RepositoryConnection.class));
    doReturn(dist).when(utilsService).getExpectedObject(eq(DISTRIBUTION_IRI), eq(distributionFactory), any(RepositoryConnection.class));
    Optional<Distribution> result = manager.getUnversionedDistribution(distributedCatalogId, UNVERSIONED_RECORD_IRI, DISTRIBUTION_IRI);
    verify(utilsService).getRecord(eq(distributedCatalogId), eq(UNVERSIONED_RECORD_IRI), eq(unversionedRecordFactory), any(RepositoryConnection.class));
    verify(utilsService).getExpectedObject(eq(DISTRIBUTION_IRI), eq(distributionFactory), any(RepositoryConnection.class));
    assertTrue(result.isPresent());
    assertEquals(dist, result.get());
}