@Test
public void startDeleteActivityTest() throws Exception {

    // Setup
    when(provenanceService.createActivity(any(ActivityConfig.class))).thenReturn(deleteActivity);
    entity.addProperty(VALUE_FACTORY.createLiteral("system"), VALUE_FACTORY.createIRI(predAtLocation));
    deleteActivity.addInvalidated(entity);
    deleteActivity.getModel().addAll(entity.getModel());
    DeleteActivity result = utils.startDeleteActivity(user, VALUE_FACTORY.createIRI(recordIri));
    verify(provenanceService).createActivity(any(ActivityConfig.class));
    verify(provenanceService).addActivity(any(DeleteActivity.class));
    verify(mobi).getServerIdentifier();
    assertTrue(result.getModel().contains(deleteActivity.getResource(), VALUE_FACTORY.createIRI(Activity.startedAtTime_IRI), null));
    assertTrue(result.getModel().contains(deleteActivity.getResource(), VALUE_FACTORY.createIRI(predAtLocation), VALUE_FACTORY.createLiteral(mobi.getServerIdentifier().toString())));
    assertEquals(1, deleteActivity.getInvalidated().size());
    Entity resultEntity = deleteActivity.getInvalidated().iterator().next();
    assertEquals(entity.getResource(), resultEntity.getResource());
    assertTrue(resultEntity.getModel().contains(resultEntity.getResource(), VALUE_FACTORY.createIRI(Entity.generatedAtTime_IRI), null));
    assertTrue(resultEntity.getModel().contains(resultEntity.getResource(), VALUE_FACTORY.createIRI(predAtLocation), VALUE_FACTORY.createLiteral("system")));
}