@Test
public void testAddUnversionedDistribution() throws Exception {

    // Setup:
    UnversionedRecord record = unversionedRecordFactory.createNew(NEW_IRI);
    doReturn(record).when(utilsService).getRecord(eq(distributedCatalogId), eq(UNVERSIONED_RECORD_IRI), eq(unversionedRecordFactory), any(RepositoryConnection.class));
    Distribution dist = distributionFactory.createNew(NEW_IRI);
    manager.addUnversionedDistribution(distributedCatalogId, UNVERSIONED_RECORD_IRI, dist);
    verify(utilsService).getRecord(eq(distributedCatalogId), eq(UNVERSIONED_RECORD_IRI), eq(unversionedRecordFactory), any(RepositoryConnection.class));
    verify(utilsService).updateObject(eq(record), any(RepositoryConnection.class));
    verify(utilsService).addObject(eq(dist), any(RepositoryConnection.class));
    assertEquals(1, record.getUnversionedDistribution_resource().size());
}