@Test
public void testAddInProgressCommit() throws Exception {

    // Setup:
    User user = userFactory.createNew(USER_IRI);
    InProgressCommit commit = inProgressCommitFactory.createNew(NEW_IRI);
    commit.setProperty(user.getResource(), VALUE_FACTORY.createIRI(Activity.wasAssociatedWith_IRI));
    doReturn(Optional.empty()).when(utilsService).getInProgressCommitIRI(eq(VERSIONED_RDF_RECORD_IRI), eq(USER_IRI), any(RepositoryConnection.class));
    manager.addInProgressCommit(distributedCatalogId, VERSIONED_RDF_RECORD_IRI, commit);
    verify(utilsService).getInProgressCommitIRI(eq(VERSIONED_RDF_RECORD_IRI), eq(USER_IRI), any(RepositoryConnection.class));
    verify(utilsService).getRecord(eq(distributedCatalogId), eq(VERSIONED_RDF_RECORD_IRI), eq(versionedRDFRecordFactory), any(RepositoryConnection.class));
    verify(utilsService).addObject(eq(commit), any(RepositoryConnection.class));
    assertTrue(commit.getOnVersionedRDFRecord_resource().isPresent());
    assertEquals(VERSIONED_RDF_RECORD_IRI, commit.getOnVersionedRDFRecord_resource().get());
}