@Test(expected = IllegalArgumentException.class)
public void testAddInProgressCommitWithTakenResource() {

    InProgressCommit commit = inProgressCommitFactory.createNew(IN_PROGRESS_COMMIT_IRI);
    commit.setProperty(USER_IRI, 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, times(0)).addObject(eq(commit), any(RepositoryConnection.class));
    verify(utilsService).throwAlreadyExists(IN_PROGRESS_COMMIT_IRI, inProgressCommitFactory);
}