@Test
public void testAddInProgressCommitWhenYouAlreadyHaveOne() {

    // Setup:
    InProgressCommit commit = inProgressCommitFactory.createNew(NEW_IRI);
    commit.setProperty(USER_IRI, VALUE_FACTORY.createIRI(Activity.wasAssociatedWith_IRI));
    doReturn(Optional.of(NEW_IRI)).when(utilsService).getInProgressCommitIRI(eq(VERSIONED_RDF_RECORD_IRI), eq(USER_IRI), any(RepositoryConnection.class));
    thrown.expect(IllegalStateException.class);
    thrown.expectMessage("User " + USER_IRI + " already has an InProgressCommit for Record " + VERSIONED_RDF_RECORD_IRI);
    manager.addInProgressCommit(distributedCatalogId, VERSIONED_RDF_RECORD_IRI, commit);
    verify(utilsService, times(0)).addObject(eq(commit), any(RepositoryConnection.class));
}