@Test
public void testApplyInProgressCommit() throws Exception {

    // Setup:
    Difference diff = new Difference.Builder().build();
    Model entity = MODEL_FACTORY.createModel();
    Model expected = MODEL_FACTORY.createModel();
    doReturn(diff).when(utilsService).getCommitDifference(eq(IN_PROGRESS_COMMIT_IRI), any(RepositoryConnection.class));
    doReturn(expected).when(utilsService).applyDifference(entity, diff);
    Model result = manager.applyInProgressCommit(IN_PROGRESS_COMMIT_IRI, entity);
    assertEquals(expected, result);
    verify(utilsService).validateResource(eq(IN_PROGRESS_COMMIT_IRI), eq(inProgressCommitFactory.getTypeIRI()), any(RepositoryConnection.class));
    verify(utilsService).getCommitDifference(eq(IN_PROGRESS_COMMIT_IRI), any(RepositoryConnection.class));
    verify(utilsService).applyDifference(entity, diff);
}