@Test
public void testMigrateUserTaskProcessInstanceWithNodeMapping() {

    createRuntimeManagers("migration/v1/BPMN2-UserTask-v1.bpmn2", "migration/v2/BPMN2-UserTask-v2.bpmn2");
    assertNotNull(managerV1);
    assertNotNull(managerV2);
    
    RuntimeEngine runtime = managerV1.getRuntimeEngine(EmptyContext.get());
    KieSession ksession = runtime.getKieSession();
    assertNotNull(ksession); 
    
    ProcessInstance pi1 = ksession.startProcess(PROCESS_ID_V1);
    assertNotNull(pi1);
    assertEquals(ProcessInstance.STATE_ACTIVE, pi1.getState());   
    
    TaskService taskService = runtime.getTaskService();        
    TaskSummary task = getTask(taskService);
    managerV1.disposeRuntimeEngine(runtime);
    
    assertEquals(PROCESS_ID_V1, task.getProcessId());
    assertEquals(DEPLOYMENT_ID_V1, task.getDeploymentId());
    assertEquals(TASK_NAME_V1, task.getName());        
    
    MigrationSpec migrationSpec = new MigrationSpec(DEPLOYMENT_ID_V1, pi1.getId(), DEPLOYMENT_ID_V2, PROCESS_ID_V2);
    MigrationManager migrationManager = new MigrationManager(migrationSpec);
    MigrationReport report = migrationManager.migrate(Collections.singletonMap("_2", "_2"));        
    assertNotNull(report);
    assertTrue(report.isSuccessful());
    
    assertMigratedProcessInstance(PROCESS_ID_V2, pi1.getId(), ProcessInstance.STATE_ACTIVE);
            
    runtime = managerV2.getRuntimeEngine(EmptyContext.get());
    taskService = runtime.getTaskService();        
    assertMigratedTaskAndComplete(taskService, PROCESS_ID_V2, pi1.getId(), TASK_NAME_V2);
    
    assertMigratedProcessInstance(PROCESS_ID_V2, pi1.getId(), ProcessInstance.STATE_COMPLETED);
    
    managerV2.disposeRuntimeEngine(runtime);
}